]> git.parisson.com Git - django-social-auth.git/commitdiff
Inicial per backend settings, just URLs so far.
authorMatías Aguirre <matiasaguirre@gmail.com>
Wed, 22 Feb 2012 13:11:25 +0000 (11:11 -0200)
committerMatías Aguirre <matiasaguirre@gmail.com>
Wed, 22 Feb 2012 13:11:25 +0000 (11:11 -0200)
README.rst
doc/configuration.rst
social_auth/views.py

index 543fbb6a8577b8f87f6870ab4e924e356a66ea56..46f567b195044b01a6c4b5add9321a922cb78538 100644 (file)
@@ -178,6 +178,11 @@ Configuration
 
     SOCIAL_AUTH_DISCONNECT_REDIRECT_URL = '/account-disconnected-redirect-url/'
 
+  Users will be redirected to ``LOGIN_ERROR_URL`` in case of error or user
+  cancellation on some backends. This URL can be override by this setting::
+
+    SOCIAL_AUTH_BACKEND_ERROR_URL = '/new-error-url/'
+
   In case of authentication error, the message can be stored in session
   if the following setting is defined::
 
@@ -350,6 +355,19 @@ Configuration
   It's default value is ``DEBUG``, so you need to set it to ``False`` to avoid
   tracebacks when ``DEBUG = True``.
 
+
+Some settings can be tweak by backend by adding the backend name prefix (all
+uppercase and replace ``-`` with ``_``), here's the supported settings so far::
+
+        LOGIN_ERROR_URL
+        SOCIAL_AUTH_BACKEND_ERROR_URL
+        SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL
+        SOCIAL_AUTH_DISCONNECT_REDIRECT_URL
+        SOCIAL_AUTH_NEW_USER_REDIRECT_URL
+        SOCIAL_AUTH_LOGIN_REDIRECT_URL
+        SOCIAL_AUTH_INACTIVE_USER_URL
+
+
 Authentication Pipeline
 -----------------------
 
index 01fcea746994b30324fc4952bf8908e33ca0b4bf..73c38854b59bb4a4bbe338f0c99b7446381814dc 100644 (file)
@@ -75,6 +75,11 @@ Configuration
 
     SOCIAL_AUTH_DISCONNECT_REDIRECT_URL = '/account-disconnected-redirect-url/'
 
+  Users will be redirected to ``LOGIN_ERROR_URL`` in case of error or user
+  cancellation on some backends. This URL can be override by this setting::
+
+    SOCIAL_AUTH_BACKEND_ERROR_URL = '/new-error-url/'
+
   In case of authentication error, the message can be stored in session
   if the following setting is defined::
 
@@ -246,6 +251,18 @@ Configuration
   It's default value is ``DEBUG``, so you need to set it to ``False`` to avoid
   tracebacks when ``DEBUG = True``.
 
+Some settings can be tweak by backend by adding the backend name prefix (all
+uppercase and replace ``-`` with ``_``), here's the supported settings so far::
+
+        LOGIN_ERROR_URL
+        SOCIAL_AUTH_BACKEND_ERROR_URL
+        SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL
+        SOCIAL_AUTH_DISCONNECT_REDIRECT_URL
+        SOCIAL_AUTH_NEW_USER_REDIRECT_URL
+        SOCIAL_AUTH_LOGIN_REDIRECT_URL
+        SOCIAL_AUTH_INACTIVE_USER_URL
+
+
 .. _Model Manager: http://docs.djangoproject.com/en/dev/topics/db/managers/#managers
 .. _Login URL: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#login-url
 .. _Login redirect URL: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#login-redirect-url
index b278dc8ffa9eadce3f7c7f446df82aaa9a109f7d..ab8463a1d3f9e5a8fc1f9913e3c897338bbcb323 100644 (file)
@@ -173,11 +173,14 @@ def complete_process(request, backend, *args, **kwargs):
 
             # Remove possible redirect URL from session, if this is a new
             # account, send him to the new-users-page if defined.
-            new_user_redirect = setting('SOCIAL_AUTH_NEW_USER_REDIRECT_URL')
+            new_user_redirect = backend_setting(backend,
+                                           'SOCIAL_AUTH_NEW_USER_REDIRECT_URL')
             if new_user_redirect and getattr(user, 'is_new', False):
                 url = new_user_redirect
             else:
-                url = redirect_value or DEFAULT_REDIRECT
+                url = redirect_value or \
+                      backend_setting('SOCIAL_AUTH_LOGIN_REDIRECT_URL') or \
+                      DEFAULT_REDIRECT
         else:
             url = backend_setting(backend, 'SOCIAL_AUTH_INACTIVE_USER_URL',
                                   LOGIN_ERROR_URL)