Skip Django Allauth " You are about to sign in using a third party account from Google" page

Viewed 415

How can I skip the page and automatically logged in users, when they clicked on Login in With Google. enter image description here

3 Answers

Instead of adding anchor tag add form and it will sign in User directly

<form action="{% provider_login_url 'google' %}" method="post">
  {% csrf_token %}
  <button type="submit">SIGN IN WITH GOOGLE</button>
</form>

You need to set up SOCIALACCOUNT_LOGIN_ON_GET=True in your configuration (by default it's False). according to https://django-allauth.readthedocs.io/en/latest/configuration.html:

SOCIALACCOUNT_LOGIN_ON_GET (=False)

Controls whether or not the endpoints for initiating a social login (for example, “/accounts/google/login/”) require a POST request to initiate the handshake. For security considerations, it is strongly recommended to require POST requests.

Just Add this: SOCIALACCOUNT_LOGIN_ON_GET=True

Related