diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-12-04 01:53:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 17:53:57 +0000 |
commit | 171edfc79373fe0e80e064748c0cec8cc93aea2e (patch) | |
tree | 9ec0bf99426d3350cc7e8775cc6012706a8686c8 | |
parent | 690d07470cab795d64153c77405aba7dc5814a9e (diff) | |
download | gitea-171edfc79373fe0e80e064748c0cec8cc93aea2e.tar.gz gitea-171edfc79373fe0e80e064748c0cec8cc93aea2e.zip |
Fix oauth2 login methods (#32698)
Regression of #32687
It should use "or" but not "and", otherwise the oauth2 methods won't
show when no ENABLE_OPENID_SIGNIN
-rw-r--r-- | templates/user/auth/signin_inner.tmpl | 5 | ||||
-rw-r--r-- | templates/user/auth/signup_inner.tmpl | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index e0a19a9743..3124048d36 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -48,10 +48,11 @@ </div> </form> {{end}}{{/*if .EnablePasswordSignInForm*/}} - {{if and .OAuth2Providers .EnableOpenIDSignIn .EnablePasswordSignInForm}} + {{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}} + {{if and $showOAuth2Methods .EnablePasswordSignInForm}} <div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div> {{end}} - {{if and .OAuth2Providers .EnableOpenIDSignIn}} + {{if $showOAuth2Methods}} {{template "user/auth/oauth_container" .}} {{end}} </div> diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index 6969003968..41d0cd49b5 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -47,8 +47,8 @@ </button> </div> {{end}} - - {{if and .OAuth2Providers .EnableOpenIDSignIn}} + {{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}} + {{if $showOAuth2Methods}} <div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div> {{template "user/auth/oauth_container" .}} {{end}} |