Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 0 additions & 194 deletions modules/context/auth.go

This file was deleted.

2 changes: 1 addition & 1 deletion routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func Routes(ctx gocontext.Context) *web.Route {
// Get user from session if logged in.
m.Use(auth.APIAuth(group))

m.Use(context.ToggleAPI(&context.ToggleOptions{
m.Use(auth.ToggleAPI(&auth.ToggleOptions{
SignInRequired: setting.Service.RequireSignInView,
}))

Expand Down
12 changes: 6 additions & 6 deletions routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ func Routes(ctx gocontext.Context) *web.Route {

// RegisterRoutes register routes
func RegisterRoutes(m *web.Route) {
reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
ignExploreSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView || setting.Service.Explore.RequireSigninView})
ignSignInAndCsrf := context.Toggle(&context.ToggleOptions{DisableCSRF: true})
reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true})
reqSignIn := auth_service.Toggle(&auth_service.ToggleOptions{SignInRequired: true})
ignSignIn := auth_service.Toggle(&auth_service.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
ignExploreSignIn := auth_service.Toggle(&auth_service.ToggleOptions{SignInRequired: setting.Service.RequireSignInView || setting.Service.Explore.RequireSigninView})
ignSignInAndCsrf := auth_service.Toggle(&auth_service.ToggleOptions{DisableCSRF: true})
reqSignOut := auth_service.Toggle(&auth_service.ToggleOptions{SignOutRequired: true})
validation.AddBindingRules()

linkAccountEnabled := func(ctx *context.Context) {
Expand Down Expand Up @@ -551,7 +551,7 @@ func RegisterRoutes(m *web.Route) {

m.Get("/avatar/{hash}", user.AvatarByEmailHash)

adminReq := context.Toggle(&context.ToggleOptions{SignInRequired: true, AdminRequired: true})
adminReq := auth_service.Toggle(&auth_service.ToggleOptions{SignInRequired: true, AdminRequired: true})

// ***** START: Admin *****
m.Group("/admin", func() {
Expand Down
Loading