feat: oauth login box (#874)

This commit is contained in:
Zack 2024-10-16 14:00:03 +08:00 committed by GitHub
parent 3c02fa253f
commit 63739fc49c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 9 deletions

View File

@ -28,6 +28,7 @@
align-items: center;
justify-content: center;
width: 100%;
flex-wrap: wrap;
}
.oauth-icon {

View File

@ -94,17 +94,25 @@
<h3>OAuth Login</h3>
<div id="oauth-container">
{% for provider in oauth_providers %}
<div class="oauth-icon">
<a href="/gotrue/authorize?provider={{ provider|escape }}&redirect_to={{ oauth_redirect_to|default("/web/login-callback")|escape }}">
<div
hx-get="../assets/{{ provider|escape }}/logo.html"
hx-trigger="load"
hx-swap="outerHTML"
></div>
<div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center">
{% for provider in oauth_providers %}
<a
href="/gotrue/authorize?provider={{ provider|escape }}&redirect_to={{ oauth_redirect_to|default("/web/login-callback")|escape }}"
style="text-decoration: none"
>
<div style="display: flex; align-items: center; border: 1px solid; margin: 4px; border-radius: 4px; height: 64px">
<div> &nbsp&nbsp{{ provider }} </div>
<div class="oauth-icon">
<div
hx-get="../assets/{{ provider|escape }}/logo.html"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
</div>
</a>
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}