Cannot dynamically redirect to last visited page using django social auth

If the page is a specific event. The user can log in using django social auth, but redirect them to a static URL, with the option below

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/dashboard/' 

I was wondering if there is a dynamic way to redirect to the page where they entered. I tried this, but it did not work.

 {% url socialauth_begin 'facebook' %}?redirect_uri={{ request.get_full_path }} 

Any suggestions would be greatly appreciated.

Matthew

+4
source share
1 answer

According to the source code, you need to set ?next= .

Like {% url socialauth_begin 'facebook' %}?next={{ request.get_full_path }} or another field name if set to REDIRECT_FIELD_NAME

+7
source

Source: https://habr.com/ru/post/1491928/


All Articles