From e352c6d84ed25e9bda8168f7e20719a9789fb043 Mon Sep 17 00:00:00 2001 From: User Date: Sat, 18 Feb 2012 13:21:23 -0500 Subject: [PATCH] Get GAE backend working properly. --- social_auth/backends/gae.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/social_auth/backends/gae.py b/social_auth/backends/gae.py index ede1c0b..0d57a37 100644 --- a/social_auth/backends/gae.py +++ b/social_auth/backends/gae.py @@ -28,7 +28,7 @@ class GAEBackend(SocialAuthBackend): # 'issuer': 'browserid.org'} user = users.get_current_user() return {USERNAME: user.user_id(), - 'email': user.email, + 'email': user.email(), 'fullname': '', 'first_name': '', 'last_name': ''} @@ -39,13 +39,19 @@ class GAEAuth(BaseAuth): AUTH_BACKEND = GAEBackend def auth_url(self): - return users.create_login_url() + return users.create_login_url('/complete/gae') def auth_complete(self, *args, **kwargs): - """Completes loging process, must return user instance""" + """Completes login process, must return user instance""" if not users.get_current_user(): raise ValueError('Authentication error') + """ Setting these two are necessary for BaseAuth.authenticate to work """ + kwargs.update({ + 'response' : '', + self.AUTH_BACKEND.name: True + }) + return authenticate(*args, **kwargs) # Backend definition -- 2.39.5