From 146f35d8dd22efdad27420ed529bb60ee9b21eaf Mon Sep 17 00:00:00 2001 From: yekibud Date: Fri, 20 Jan 2012 11:04:48 -0800 Subject: [PATCH] added GOOGLE_ prefix to WHITE_LISTED_DOMAINS setting --- doc/backends/google.rst | 2 +- social_auth/backends/google.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/backends/google.rst b/doc/backends/google.rst index 271f2f6..c73cc7e 100644 --- a/doc/backends/google.rst +++ b/doc/backends/google.rst @@ -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 diff --git a/social_auth/backends/google.py b/social_auth/backends/google.py index 0748998..3f2d202 100644 --- a/social_auth/backends/google.py +++ b/social_auth/backends/google.py @@ -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'] -- 2.39.5