]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/openidauth/consumer.py
fixes problem with always showing alert dialog in chrome. Still working out non...
[osqa.git] / forum_modules / openidauth / consumer.py
index e9cf21164930287e7bc9e98272f177d8029137a7..cc1e97d78ef30c75bef87fd9258d623efd3fd5eb 100644 (file)
@@ -18,12 +18,12 @@ from store import OsqaOpenIDStore
 class OpenIdAbstractAuthConsumer(AuthenticationConsumer):
 
     dataype2ax_schema = {
 class OpenIdAbstractAuthConsumer(AuthenticationConsumer):
 
     dataype2ax_schema = {
-        'username': 'http://axschema.org/namePerson/friendly',
+        #'username': 'http://axschema.org/namePerson/friendly',
         'email': 'http://axschema.org/contact/email',
         'email': 'http://axschema.org/contact/email',
-        'web': 'http://axschema.org/contact/web/default',
-        'firstname': 'http://axschema.org/namePerson/first',
-        'lastname': 'http://axschema.org/namePerson/last',
-        'birthdate': 'http://axschema.org/birthDate',
+        #'web': 'http://axschema.org/contact/web/default',
+        #'firstname': 'http://axschema.org/namePerson/first',
+        #'lastname': 'http://axschema.org/namePerson/last',
+        #'birthdate': 'http://axschema.org/birthDate',
     }
 
     def get_user_url(self, request):
     }
 
     def get_user_url(self, request):
@@ -87,8 +87,8 @@ class OpenIdAbstractAuthConsumer(AuthenticationConsumer):
             (k.encode('utf8'), v.encode('utf8')) for k, v in request.GET.items()
         ])
 
             (k.encode('utf8'), v.encode('utf8')) for k, v in request.GET.items()
         ])
 
-        for i in query_dict.items():
-            print "%s : %s" % i
+        #for i in query_dict.items():
+            #print "%s : %s" % i
 
         url = get_url_host(request) + request.path
         openid_response = consumer.complete(query_dict, url)
 
         url = get_url_host(request) + request.path
         openid_response = consumer.complete(query_dict, url)
@@ -110,21 +110,15 @@ class OpenIdAbstractAuthConsumer(AuthenticationConsumer):
                     available_data = dict([
                         (t, axargs["value.%s.1" % s]) for t, s in available_types.items()
                     ])
                     available_data = dict([
                         (t, axargs["value.%s.1" % s]) for t, s in available_types.items()
                     ])
-
-                    print available_data
-                    
-
-                    #email = ax.getExtensionArgs()['value.ext0.1']
-                    #username = ax.getExtensionArgs()['value.ext0.2']
                     
                     request.session['auth_consumer_data'] = {
                     
                     request.session['auth_consumer_data'] = {
-                        'email': '',
-                        'username': ''
+                        'email': available_data.get('email', None),
                     }
 
                 except Exception, e:
                     }
 
                 except Exception, e:
-                    import sys, traceback
-                    traceback.print_exc(file=sys.stdout)
+                    pass
+                    #import sys, traceback
+                    #traceback.print_exc(file=sys.stdout)
 
             return request.GET['openid.identity']
         elif openid_response.status == CANCEL:
 
             return request.GET['openid.identity']
         elif openid_response.status == CANCEL: