'Login with Google redairecting on conformation page to continue Django
I am trying to integrate Google Authentication into my login page. I am working in Django. I have added login with Google Button on my login page, but when I click on that button, I am redirecting to accounts/google/login where it's asking for conformation to continue and menu with sign-in and sign-out.
But what I want is when I click on the button it should ask for accounts to login instead.
This is what I get on click on the button:

this is my button login code in HTML: Login.html:
{% if user.is_authenticated %}
<p>Welcome, You are logged in as {{ user.username }}</p>
{% else %}
<a href="{% provider_login_url 'google' %}">Login With Google</a>
{% endif %}
How can I skip this conformation page , it will be glad if anyone can help me out with this thank you.
Solution 1:[1]
I have uninstalled Django-allauth using the following command :
pip uninstall django-allauth
After that I have installed an older version of that using:
pip install django-allauth==0.45
Then:
python manage.py makemigrations
pytthon manage.py migrate
Done.
Solution 2:[2]
This behavior was released in version 0.47.0:
Added a new setting SOCIALACCOUNT_LOGIN_ON_GET that controls whether or not the endpoints for initiating a social login (for example, “/accounts/google/login/”) require a POST request to initiate the handshake. As requiring a POST is more secure, the default of this new setting is False.
You can add the flag in your settings.py file to avoid the intermediate page:
SOCIALACCOUNT_LOGIN_ON_GET=True
And keep using the latest version of the library.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brijal Kansara |
| Solution 2 |

