Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Social auth redirecting to the same URL

After I choose some view with the decorator login_required() the user is redirected to: http://example.com/login/?next=/anuncio/adicionar/, right?

But, after I use "Login with facebook", the user are redirected to http://example.com/login/#= instead of http://example.com/anuncio/adicionar/

It happens only if I use the python-social-auth, and not happens if I use the auth native login.

My registration/login.html - Python Social Auth link

<a class="btn btn-social btn-fw btn-lg btn-facebook" href="{% url 'social:begin' 'facebook' %}?next={{ request.path }}"><i class="fa fa-facebook"></i> Fazer login com Facebook</a>

and my Auth native login

<form action="{% url "auth:login" %}" role="form" method="POST">{% csrf_token %}
like image 489
Max Ferreira Avatar asked Jan 28 '26 15:01

Max Ferreira


1 Answers

Add login redirect url to your settins.py file

LOGIN_REDIRECT_URL = '/anuncio/adicionar/'

so when user is authenticated it will tedirect the above url

like image 171
Wagh Avatar answered Jan 31 '26 05:01

Wagh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!