]> git.parisson.com Git - django-social-auth.git/commitdiff
Correct user-defined redirect page that overrides django auth app LOGIN_REDIRECT_URL...
authorMatías Aguirre <matiasaguirre@gmail.com>
Fri, 15 Apr 2011 04:03:55 +0000 (01:03 -0300)
committerMatías Aguirre <matiasaguirre@gmail.com>
Fri, 15 Apr 2011 04:03:55 +0000 (01:03 -0300)
README.rst
doc/configuration.rst
social_auth/views.py

index 25c8cb82ec87f8cc077d70f592b5853678fbf385..3e2a9b9e55009e21fca05c95e14d6ca9445c50b4 100644 (file)
@@ -152,6 +152,11 @@ Configuration
 
   Check Django documentation at `Login URL`_ and `Login redirect URL`_
 
+  If a custom redirect URL is needed that must be different to LOGIN_URL,
+  define the setting::
+
+    SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+
   In case of authentication error, the message can be stored in session
   if the following setting is defined::
 
index 91bb7bc73788346b669c6467f480ca0e139af8fa..5330fe5a95e7107776bf6677c7af9ce3e0afbe9c 100644 (file)
@@ -63,6 +63,11 @@ Configuration
 
   Check Django documentation at `Login URL`_ and `Login redirect URL`_
 
+  If a custom redirect URL is needed that must be different to LOGIN_URL,
+  define the setting::
+
+    SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+
   In case of authentication error, the message can be stored in session
   if the following setting is defined::
 
index 1268e271f50e0ab1f6eef90621a62addbeaac262..521b085d1a926c5d124530457a4c415892784df4 100644 (file)
@@ -11,7 +11,8 @@ from social_auth.backends import get_backend
 from social_auth.utils import sanitize_redirect
 
 
-DEFAULT_REDIRECT = getattr(settings, 'LOGIN_REDIRECT_URL', '')
+DEFAULT_REDIRECT = getattr(settings, 'SOCIAL_AUTH_LOGIN_REDIRECT_URL', '') or \
+                   getattr(settings, 'LOGIN_REDIRECT_URL', '')
 
 
 def auth(request, backend):
@@ -87,8 +88,7 @@ def disconnect(request, backend):
     return HttpResponseRedirect(url)
 
 
-def auth_process(request, backend, complete_url_name,
-                 default_redirect=DEFAULT_REDIRECT):
+def auth_process(request, backend, complete_url_name):
     """Authenticate using social backend"""
     redirect = reverse(complete_url_name, args=(backend,))
     backend = get_backend(backend, request, redirect)