summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-11-03 09:41:00 +0800
committerGitHub <noreply@github.com>2023-11-03 01:41:00 +0000
commit1bf5527eac6b947010c8faf408f6747de2a2384f (patch)
treea78319354a20c1ca68d6ab78268ae9811a7f854c /templates
parent80715ae5c7ca41a8ee2ad7b6459c587cc63195bf (diff)
downloadgitea-1bf5527eac6b947010c8faf408f6747de2a2384f.tar.gz
gitea-1bf5527eac6b947010c8faf408f6747de2a2384f.zip
Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source (#27798)
The steps to reproduce it. First, create a new oauth2 source. Then, a user login with this oauth2 source. Disable the oauth2 source. Visit users -> settings -> security, 500 will be displayed. This is because this page only load active Oauth2 sources but not all Oauth2 sources.
Diffstat (limited to 'templates')
-rw-r--r--templates/user/auth/signin_inner.tmpl7
-rw-r--r--templates/user/auth/signup_inner.tmpl7
2 files changed, 6 insertions, 8 deletions
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl
index f38b0a2608..7f744b24d8 100644
--- a/templates/user/auth/signin_inner.tmpl
+++ b/templates/user/auth/signin_inner.tmpl
@@ -52,16 +52,15 @@
</div>
{{end}}
- {{if and .OrderedOAuth2Names .OAuth2Providers}}
+ {{if .OAuth2Providers}}
<div class="divider divider-text">
{{ctx.Locale.Tr "sign_in_or"}}
</div>
<div id="oauth2-login-navigator" class="gt-py-2">
<div class="gt-df gt-fc gt-jc">
<div id="oauth2-login-navigator-inner" class="gt-df gt-fc gt-fw gt-ac gt-gap-3">
- {{range $key := .OrderedOAuth2Names}}
- {{$provider := index $.OAuth2Providers $key}}
- <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
+ {{range $provider := .OAuth2Providers}}
+ <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$provider.Name}}">
{{$provider.IconHTML 28}}
{{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
</a>
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl
index 068ccbc618..c75e33a18a 100644
--- a/templates/user/auth/signup_inner.tmpl
+++ b/templates/user/auth/signup_inner.tmpl
@@ -56,16 +56,15 @@
{{end}}
{{end}}
- {{if and .OrderedOAuth2Names .OAuth2Providers}}
+ {{if .OAuth2Providers}}
<div class="divider divider-text">
{{ctx.Locale.Tr "sign_in_or"}}
</div>
<div id="oauth2-login-navigator" class="gt-py-2">
<div class="gt-df gt-fc gt-jc">
<div id="oauth2-login-navigator-inner" class="gt-df gt-fc gt-fw gt-ac gt-gap-3">
- {{range $key := .OrderedOAuth2Names}}
- {{$provider := index $.OAuth2Providers $key}}
- <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
+ {{range $provider := .OAuth2Providers}}
+ <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$provider.Name}}">
{{$provider.IconHTML 28}}
{{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
</a>