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; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
flex-wrap: wrap;
} }
.oauth-icon { .oauth-icon {

View File

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