omab / django-social-auth

Django social authentication made simple
https://groups.google.com/group/django-social-auth
BSD 3-Clause "New" or "Revised" License
2.65k stars 756 forks source link

/complete/<backend> crashing #754

Closed boris-savic closed 11 years ago

boris-savic commented 11 years ago

Facebook redirects users to /complete/facebook when they click on shared via APP_NAME in posts that have beed shared via FB app. This is annoying since the purpose of that url is for facebook callbacks to complete user authentication. Since we can't specify two different URLs in FB App settings it makes sense to fix the bug that causes the page to crash if complete url is called with no completion parameters.

This commit fixes the HTTP 500 error that was generated if no parameters were provided (as they are if users login via /login/facebook). It now redirects user to error page if configured.

omab commented 11 years ago

I think that this should be fixed in Facebook backend since it's the only code that will use that so far.

boris-savic commented 11 years ago

I haven't tested Google oAuth or Twitter indeed, but anyway I find it inconvenient that in case of AuthException thing just dies instead redirects to LOGIN_ERROR_URL.

omab commented 11 years ago

@boris-savic, for that purpose there's a middleware to properly handle the errors, you can extend it and override the behavior if needed.

boris-savic commented 11 years ago

Wasn't aware of that. Thanks.

omab commented 11 years ago

@boris-savic, no problem, here's a link to docs http://django-social-auth.readthedocs.org/en/latest/configuration.html#exceptions-middleware. I'll close this PR.