From 171edfc79373fe0e80e064748c0cec8cc93aea2e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 4 Dec 2024 01:53:57 +0800 Subject: [PATCH] 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 --- templates/user/auth/signin_inner.tmpl | 5 +++-- 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 @@ {{end}}{{/*if .EnablePasswordSignInForm*/}} - {{if and .OAuth2Providers .EnableOpenIDSignIn .EnablePasswordSignInForm}} + {{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}} + {{if and $showOAuth2Methods .EnablePasswordSignInForm}}
{{ctx.Locale.Tr "sign_in_or"}}
{{end}} - {{if and .OAuth2Providers .EnableOpenIDSignIn}} + {{if $showOAuth2Methods}} {{template "user/auth/oauth_container" .}} {{end}} 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 @@ {{end}} - - {{if and .OAuth2Providers .EnableOpenIDSignIn}} + {{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}} + {{if $showOAuth2Methods}}
{{ctx.Locale.Tr "sign_in_or"}}
{{template "user/auth/oauth_container" .}} {{end}}