-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
omniauth callback redirect not working properly when using namespace/scope #362
Comments
Related to issue #166 |
Same issue here |
Same issue here! |
absolutely the same issue |
Seem to be having the same issue too. When using FB oauth, I get redirected to:
|
Same here. FB and Google+ login is broken on manshar.com. Investigating what's going on. |
same problem here, as I have only one model concerned, I override the |
…ssue for namespaced model
Fixes Issue lynndylanhurley#362: Fixes for the omniauth redirection issue for namesp…
Fixes Issue #362: Fixes for the omniauth redirection issue for namesp…
Should be fixed via #476 . Closing but can re-open as needed. |
not working at my side:
on this line in redirect_route = "#{request.protocol}#{request.host_with_port}/#{Devise.mappings[devise_mapping].fullpath}/#{params[:provider]}/callback" |
same issue devise_mapping => :user |
Same issue described by @magnumfonseca devise_mapping => :user |
Should be fixed now as of #540 |
In 0.1.34 I found that the callback redirect does not work with this routes definition:
Instead of redirecting to /api/v1/auth/facebook/callback, it will try to redirect to /users/facebook/callback which does not exist. So I figured this is a problem because I am trying to use both devise and devise_token_auth in parallel, but even without the devise_for (and nothing else in the routes) it does not work and it dies on on some NilClass error:
This undefined method seems to be related to Devise.mappings[:users] being nil, whereas Devise.mappings[:api_user] is working.
As far as I can tell it is because of this code in the devise_token_auth application_controller.rb, where in my case it apparently falls back to the Devise.mappings.values.first but I don't really have enough of an understanding of the gem to tell how it should be improved:
As an ugly workaround, I thought to overwrite the commented out line in the redirect_callbacks method in omniauth_callbacks_controller.rb by the one below it:
That doesn't work either because now the value of redirect_route is /auth/facebook/callback instead of /api/v1/auth/facebook/callback. So I ended up doing it like this:
Of course this works for me because I don't have multiple models, but it seems to me that this namespace/scope structure should be automatically detected and the appropriate route be used for the callback redirect.
Thanks!
The text was updated successfully, but these errors were encountered: