I am trying to setup a redirect_back when signing in w/ omniauth. Therefore, I tried to overwrite Devise::OmniauthCallbacksController#passthru with
def passthru
binding.pry
super
end
This does not get triggered, through my routes seem to be correct:
user_omniauth_authorize GET|POST /users/auth/:provider(.:format) oauth_callbacks#passthru
I tried renaming the method to passthru2 and adding the following lines to routes.rb
devise_scope :user do
get '/users/auth/:provider' => 'oauth_callbacks#passthru2'
end
Which still results in
user_omniauth_authorize GET|POST /users/auth/:provider(.:format) oauth_callbacks#passthru
Appending as: user_omniauth_authorize has no effect either.
Now I am confused because according to the wiki and SO, this is how it should work. Am I missing s.th. ( again ;) )?
I don't see #passthru getting called at all. Is it possible that omniauth workflow changed, and they don't rely on 404 anymore? If so, it seems save to remove #passthru.
I am not sure, sorry. Could you please investigate and let us know? :)
Any news? :) Let us know if you find anything or if we can help further!
I digged into it a bit and I think that it doesn't evaluate the response of the underlying app, but handles login based on the path that is called (see call! in strategy.rb).
However, I rewinded a couple of month and didn't find any trace back then either. So maybe I am looking at the wrong place.
Since I lack time to dig deeper, I'll open an issue at omniauth. Guess they'll know best.
Ok, thanks @rweng ! We are closing this for now, if you have more info, please let us know!
Alright, seems like this calling throu was once part of omni-auth but is gone for quite some time now: https://github.com/intridea/omniauth/issues/681
I suggest deprecating or removing the passthrou method from code and wiki.
@rweng Thanks! Could you please update the wiki? We will remove it from the code after the next batch of releases. :)
:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart:
So just FYI I'm using devise 4.3 and I have this "omniauth_callbacks#passthru" in my routes so I'm guessing it's still here.
devise 4.6.2 shows user_blahblah_omniauth_authorize GET|POST /users/auth/blahblah(.:format) users/omniauth_callbacks#passthru
user_XXX_omniauth_authorize GET|POST /users/auth/XXX(.:format) users/omniauth_callbacks#passthru
passthru still there in 4.7.1
Most helpful comment
user_XXX_omniauth_authorize GET|POST /users/auth/XXX(.:format) users/omniauth_callbacks#passthru
passthru still there in 4.7.1