third parties.
------
+----
Demo
------
+----
There's a demo at http://social.matiasaguirre.net/.
Note: It lacks some backends support at the moment.
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+ A different URL could be defined for newly registered users::
+
+ SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/new-users-login-url/'
+
In case of authentication error, the message can be stored in session
if the following setting is defined::
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+ A different URL could be defined for newly registered users::
+
+ SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/new-users-login-url/'
+
In case of authentication error, the message can be stored in session
if the following setting is defined::
# Update user account data.
self.update_user_details(user, response, details, is_new)
+ setattr(user, 'is_new', is_new)
# Update extra_data storage, unless disabled by setting
if LOAD_EXTRA_DATA:
DEFAULT_REDIRECT = getattr(settings, 'SOCIAL_AUTH_LOGIN_REDIRECT_URL', '') or \
getattr(settings, 'LOGIN_REDIRECT_URL', '')
+NEW_USER_REDIRECT = getattr(settings, 'SOCIAL_AUTH_NEW_USER_REDIRECT_URL', '')
SOCIAL_AUTH_LAST_LOGIN = getattr(settings, 'SOCIAL_AUTH_LAST_LOGIN',
'social_auth_last_login_backend')
social_user = user.social_user
if social_user.expiration_delta():
request.session.set_expiry(social_user.expiration_delta())
- url = request.session.pop(REDIRECT_FIELD_NAME, '') or DEFAULT_REDIRECT
+
+ url = request.session.pop(REDIRECT_FIELD_NAME, '')
+ if not url:
+ if NEW_USER_REDIRECT and getattr(user, 'is_new', False):
+ url = NEW_USER_REDIRECT
+ else:
+ url = DEFAULT_REDIRECT
# store last login backend name in session
request.session[SOCIAL_AUTH_LAST_LOGIN] = social_user.provider