Reduce clicks on google login
This commit is contained in:
@@ -14,13 +14,11 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% comment %}
|
||||
The button is a GET to allauth's google_login view -- not a POST form --
|
||||
because the actual OAuth handshake happens via a 302 redirect to Google.
|
||||
The `?next=` from `/accounts/login/?next=/wherever/` is forwarded so the
|
||||
user lands back on the page they were trying to reach.
|
||||
{% endcomment %}
|
||||
<a href="{% url 'google_login' %}{% if request.GET.next %}?next={{ request.GET.next|urlencode }}{% endif %}"
|
||||
{# POST (not GET) so allauth's LoginView skips its intermediate confirm page and 302s straight to Google. #}
|
||||
<form method="post" action="{% url 'google_login' %}">
|
||||
{% csrf_token %}
|
||||
{% if request.GET.next %}<input type="hidden" name="next" value="{{ request.GET.next }}">{% endif %}
|
||||
<button type="submit"
|
||||
class="flex items-center justify-center gap-3 w-full px-4 py-3 rounded-md border border-slate-300 bg-white hover:bg-slate-50 text-slate-900 font-medium shadow-sm">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.75h3.57c2.08-1.92 3.28-4.74 3.28-8.07z"/>
|
||||
@@ -29,7 +27,8 @@
|
||||
<path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.04l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>
|
||||
</svg>
|
||||
Continue with Google
|
||||
</a>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 text-center">
|
||||
<a href="{% url 'submissions:create' %}" class="text-sm text-slate-600 hover:underline">No thanks, just submit as a guest →</a>
|
||||
|
||||
Reference in New Issue
Block a user