Disable unnecessary OpenID/OAuth2 elements#18491
Conversation
This mod fixes disabling unnecessary OpenID elements. Related: go-gitea#13129 Author-Change-Id: IB#1115256
| m.Post("/link_account_signup", bindIgnErr(forms.RegisterForm{}), auth.LinkAccountPostRegister) | ||
| m.Group("/link_account", func() { | ||
| m.Get("", auth.LinkAccount) | ||
| }, openIDSignInEnabled) |
There was a problem hiding this comment.
openIDSignInEnabled can be added to the Get and Post arguments, no need to go all fancy with Group here.
There was a problem hiding this comment.
Just tested that
m.Get("/", Home, openIDSignInEnabled)
does not forbid access to / when openIDSignInEnabled is disabled but
m.Group("/", func() {
m.Get("", Home)
}, openIDSignInEnabled)
does. Seems that simply adding openIDSignInEnabled to Get arguments does not work.
There was a problem hiding this comment.
m.Get("/", openIDSignInEnabled, Home)
works ok - will fix it.
Fixes: 8faceac Related: go-gitea#18491 (review) Author-Change-Id: IB#1115256
lunny
left a comment
There was a problem hiding this comment.
LinkAccount is not only for openID, OAuth2 could also use that. This is totally wrong.
Fixes: 8faceac Related: go-gitea#18491 (review) Author-Change-Id: IB#1115256
Fixed in 513303b. |
* giteaofficial/main: Fix issue with docker-rootless shimming script (go-gitea#18690) tests: remove redundant comparison in repo dump/restore (go-gitea#18660) [skip ci] Updated translations via Crowdin Disable unnecessary OpenID/OAuth2 elements (go-gitea#18491) Add apply-patch, basic revert and cherry-pick functionality (go-gitea#17902) C preprocessor colors improvement (go-gitea#18671) Update object repo with the migrated repository (go-gitea#18684)
This mod fixes disabling unnecessary OpenID elements. Related: go-gitea#13129 Author-Change-Id: IB#1115256
|
@pboguslawski this change (maybe) causes regressions like:
Could you propose a proper fix? (I will propose a quick fix to revert this PR for a temp approach) |
This mod fixes disabling unnecessary OpenID/OAuth2 elements.
Related: #13129
Author-Change-Id: IB#1115256