I am using python social auth to use social logins, but I cannot redirect to the last page after a successful login.
For example, if I go to the next page http://localhost:8000/docprofile/14/ and click the login button, instead of redirecting me to the last page http://localhost:8000/docprofile/14/ , it redirects me to the login page.
If I put this:
<a href="{% url 'social:begin' 'facebook' %}?next={{ request.path }}"> | Login with Facebook</a>
It redirects the login page and the URL ends with strange characters:
http://localhost:8000/login/
I also tried this:
<a href="{% url 'social:begin' 'facebook' %}?next={{ request.get_full_path }}"> | Login with Facebook</a>
This time, it follows the path /docprofile/14 , but still does not redirect me back to the login page with the URL http://localhost:8000/login/?next=/docprofile/14/#_=_
source share