]> git.parisson.com Git - django-social-auth.git/commitdiff
Get GAE backend working properly.
authorUser <user@goku.localdomain>
Sat, 18 Feb 2012 18:21:23 +0000 (13:21 -0500)
committerUser <user@goku.localdomain>
Sat, 18 Feb 2012 18:21:23 +0000 (13:21 -0500)
social_auth/backends/gae.py

index ede1c0b020d5adfd2390cdced2833b4c9df3c5e7..0d57a3791adc7927bfe008a293e07ee0a90fcd72 100644 (file)
@@ -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