Skip to content

Commit e27d6b3

Browse files
committed
Codw simplified
Fixes: 8faceac Related: #18491 (review) Author-Change-Id: IB#1115256
1 parent 8faceac commit e27d6b3

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

routers/web/web.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,9 @@ func RegisterRoutes(m *web.Route) {
277277
m.Get("/{provider}", auth.SignInOAuth)
278278
m.Get("/{provider}/callback", auth.SignInOAuthCallback)
279279
})
280-
m.Group("/link_account", func() {
281-
m.Get("", auth.LinkAccount)
282-
}, openIDSignInEnabled)
283-
m.Group("/link_account_signin", func() {
284-
m.Post("", bindIgnErr(forms.SignInForm{}), auth.LinkAccountPostSignIn)
285-
}, openIDSignInEnabled)
286-
m.Group("/link_account_signup", func() {
287-
m.Post("", bindIgnErr(forms.RegisterForm{}), auth.LinkAccountPostRegister)
288-
}, openIDSignUpEnabled)
280+
m.Get("/link_account", openIDSignInEnabled, auth.LinkAccount)
281+
m.Post("/link_account_signin", openIDSignInEnabled, bindIgnErr(forms.SignInForm{}), auth.LinkAccountPostSignIn)
282+
m.Post("/link_account_signup", openIDSignUpEnabled, bindIgnErr(forms.RegisterForm{}), auth.LinkAccountPostRegister)
289283
m.Group("/two_factor", func() {
290284
m.Get("", auth.TwoFactor)
291285
m.Post("", bindIgnErr(forms.TwoFactorAuthForm{}), auth.TwoFactorPost)
@@ -348,9 +342,7 @@ func RegisterRoutes(m *web.Route) {
348342
m.Post("/delete", security.DeleteOpenID)
349343
m.Post("/toggle_visibility", security.ToggleOpenIDVisibility)
350344
}, openIDSignInEnabled)
351-
m.Group("/account_link", func() {
352-
m.Post("", security.DeleteAccountLink)
353-
}, openIDSignInEnabled)
345+
m.Post("/account_link", openIDSignInEnabled, security.DeleteAccountLink)
354346
})
355347
m.Group("/applications/oauth2", func() {
356348
m.Get("/{id}", user_setting.OAuth2ApplicationShow)

0 commit comments

Comments
 (0)