mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Adding button to link accounts from user settings (#19792)
* Adding button to link accounts from user settings * Only display button to link user accounts when at least one OAuth2 provider is active
This commit is contained in:
parent
f2439b7e4c
commit
4698a1ec47
4 changed files with 42 additions and 5 deletions
|
@ -344,10 +344,6 @@ func RegisterRoutes(m *web.Route) {
|
|||
}, openIDSignInEnabled)
|
||||
m.Get("/sign_up", auth.SignUp)
|
||||
m.Post("/sign_up", bindIgnErr(forms.RegisterForm{}), auth.SignUpPost)
|
||||
m.Group("/oauth2", func() {
|
||||
m.Get("/{provider}", auth.SignInOAuth)
|
||||
m.Get("/{provider}/callback", auth.SignInOAuthCallback)
|
||||
})
|
||||
m.Get("/link_account", linkAccountEnabled, auth.LinkAccount)
|
||||
m.Post("/link_account_signin", linkAccountEnabled, bindIgnErr(forms.SignInForm{}), auth.LinkAccountPostSignIn)
|
||||
m.Post("/link_account_signup", linkAccountEnabled, bindIgnErr(forms.RegisterForm{}), auth.LinkAccountPostRegister)
|
||||
|
@ -452,6 +448,10 @@ func RegisterRoutes(m *web.Route) {
|
|||
m.Get("/task/{task}", reqSignIn, user.TaskStatus)
|
||||
m.Get("/stopwatches", reqSignIn, user.GetStopwatches)
|
||||
m.Get("/search", ignExploreSignIn, user.Search)
|
||||
m.Group("/oauth2", func() {
|
||||
m.Get("/{provider}", auth.SignInOAuth)
|
||||
m.Get("/{provider}/callback", auth.SignInOAuthCallback)
|
||||
})
|
||||
})
|
||||
// ***** END: User *****
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue