]> git.parisson.com Git - django-social-auth.git/commitdiff
added GOOGLE_ prefix to WHITE_LISTED_DOMAINS setting
authoryekibud <tony@yekibud.com>
Fri, 20 Jan 2012 19:04:48 +0000 (11:04 -0800)
committeryekibud <tony@yekibud.com>
Fri, 20 Jan 2012 19:04:48 +0000 (11:04 -0800)
doc/backends/google.rst
social_auth/backends/google.py

index 271f2f67de773ae2e7ed6772bcd7db4b6cc8160d..c73cc7eb40b6b0dc59717df5835f9d8396233ed2 100644 (file)
@@ -72,7 +72,7 @@ Configurable settings:
 
 - Supply a list of domain strings to be checked. The default (empty list) allows all domains.  If a list is provided and a user attempts to sign in with a Google account that is not in the list, then a ValueError will be raised and the user will be redirected to your login error page::
 
-    WHITE_LISTED_DOMAINS = ['mydomain.com']
+    GOOGLE_WHITE_LISTED_DOMAINS = ['mydomain.com']
 
 
 Orkut
index 0748998a6beb06c264f47c079244280be2f3b434..3f2d20254249b7f81c523119dd9a501b5fdfca6c 100644 (file)
@@ -47,7 +47,7 @@ GOOGLE_OPENID_URL = 'https://www.google.com/accounts/o8/id'
 EXPIRES_NAME = getattr(settings, 'SOCIAL_AUTH_EXPIRATION', 'expires')
 
 # white-listed domains (else accept all)
-WHITE_LISTED_DOMAINS = getattr(settings, 'WHITE_LISTED_DOMAINS', [])
+GOOGLE_WHITE_LISTED_DOMAINS = getattr(settings, 'GOOGLE_WHITE_LISTED_DOMAINS', [])
 
 # Backends
 class GoogleOAuthBackend(OAuthBackend):
@@ -84,7 +84,7 @@ class GoogleBackend(OpenIDBackend):
         is unique enought to flag a single user. Email comes from schema:
         http://axschema.org/contact/email"""
         # only include white-listed domains
-        if WHITE_LISTED_DOMAINS and details['email'].split('@')[1] not in WHITE_LISTED_DOMAINS: 
+        if GOOGLE_WHITE_LISTED_DOMAINS and details['email'].split('@')[1] not in GOOGLE_WHITE_LISTED_DOMAINS: 
             raise ValueError('INVALID DOMAIN')
 
         return details['email']