dtauerbach / apollo

Apollo Project website
1 stars 0 forks source link

In develop branch, when trying to sign in with Facebook the following error occurs #48

Closed dtauerbach closed 10 years ago

dtauerbach commented 10 years ago

NameError NameError: global name 'login_or_register_by_email' is not defined

Traceback (most recent call last) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1836, in call return self.wsgi_app(environ, start_response) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/home/dan/git/apollo/env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request return self.view_functionsrule.endpoint File "/home/dan/git/apollo/server/social_login.py", line 89, in facebook_login_callback login_or_register_by_email(user_data['email']) NameError: global name 'login_or_register_by_email' is not defined The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame dump(obj) dumps all that's known about the object

TizianoPerrucci commented 10 years ago

@dtauerbach this should be fixed now.

Can you try using the test server on apollo.startersquad.com ?

dtauerbach commented 10 years ago

Hey Tiziano, that is giving me an error with Facebook:

"Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."

I think this is because the Facebook oauth app is for humandataproject.net ? I'll try some /etc/hosts changes and see if I can get it to work.

dtauerbach commented 10 years ago

Hmm, still same issue. Screenshot attached. screenshot from 2013-12-16 22 34 37

Any ideas? Maybe it should be localhost?

TizianoPerrucci commented 10 years ago

@dtauerbach we're using those keys that you sent us once: SOCIAL_FACEBOOK = { 'consumer_key': '712771092084703', 'consumer_secret': 'd14a6149c359a09a2e8f1e26e816e44c' } SOCIAL_GOOGLE = { 'consumer_key': '20095406660.apps.googleusercontent.com', 'consumer_secret': 'F1uK1aHxJN3ZpCuKfsJChpGK' } They should correspondent to a facebook and google application that you created with your account.

Now if you try to login with Google it says "The redirect URI in the request: http://apollo.startersquad.com/server/google_login_callback did not match a registered redirect URI"

So it sounds a similar problem and I think the way of fixing it is to configure the facebook app and google app and give the right callback url

http://apollo.startersquad.com/server/google_login_callback -> google http://apollo.startersquad.com/server/facebook_login_callback -> facebook

Let me know if that works

dtauerbach commented 10 years ago

Think this has been resolved for a while. I updated Google, and Facebook just a moment ago. In general, using test Google/Facebook accounts is totally fine for staging environments.