From 426e695ec2e0b5d8c28b844980db2cd15680d2b1 Mon Sep 17 00:00:00 2001 From: Youngrok pak Date: Thu, 15 Dec 2011 02:58:13 +0900 Subject: [PATCH] read redirect field value from session before login() will flush session --- social_auth/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/social_auth/views.py b/social_auth/views.py index e0d0e73..a906576 100644 --- a/social_auth/views.py +++ b/social_auth/views.py @@ -148,6 +148,7 @@ def auth_process(request, backend): def complete_process(request, backend, *args, **kwargs): """Authentication complete process""" user = auth_complete(request, backend, *args, **kwargs) + redirect_value = request.session.pop(REDIRECT_FIELD_NAME, '') if user and getattr(user, 'is_active', True): login(request, user) @@ -169,7 +170,7 @@ def complete_process(request, backend, *args, **kwargs): # send him to the new-users-page if defined. url = NEW_USER_REDIRECT if NEW_USER_REDIRECT and \ getattr(user, 'is_new', False) else \ - request.session.pop(REDIRECT_FIELD_NAME, '') or \ + redirect_value or \ DEFAULT_REDIRECT else: if ERROR_MESSAGE: -- 2.39.5