Closed septerr closed 9 years ago
I'm having the same problem, I had to add the custom routes in the devise_scope as suggested by septerr
@septerr @xdmx
Hey. I just found a bug in omniauth-oauth2 that might have been the cause of this bug. I am so sorry it has taken this long to get this resolved. I hope that a new version of omniauth-oauth2 will come out soon with my fix in it, then I will release another version of this gem, hopefully fixing all of your problems.
Thank you for your patience.
– Isaac
@septerr @xdmx
Just released v2.8.0.
Please tell me if the issue persists. We can reopen from there.
FWIW I run into the same problem with omniauth-oauth2
1.4.0
. Adding the routes manually fixed it.
Still occurring for me with omniauth-oauth2 1.5.0 & omniauth-stripe-connect 2.10.0. Adding the routes manually worked, of course.
My devise route, for reference
devise_for :users,
path_names: { sign_in: 'login', sign_out: 'logout' },
controllers: {
sessions: 'users/sessions',
confirmations: 'users/confirmations',
registrations: 'users/registrations',
omniauth_callbacks: 'users/omniauth_callbacks',
invitations: 'users/invitations'
}
Not sure why this happens. But here is the scenario:
I have omniauth-stripe-connect as well as devise in my gemfile.
I have following in initializers/devise.rb: config.omniauth :stripe_connect, ENV['STRIPE_CONNECT_CLIENT_ID'], ENV['STRIPE_SECRET']
My routes.rb:
My OmniauthCallbacksController: class OmniauthCallbacksController < Devise::OmniauthCallbacksController
When I do rake routes, I see the authorize and callback paths:
I have set the callback url in my Stripe account to:
http://localhost:3000/users/auth/stripe_connect/callback
When I go to /users/auth/stripe_connect in the browser, it redirects me to connect.stripe.com as expected and after I click on the blue button 'Connect My Stripe Account', the page then redirects to http://localhost:3000/users/auth/stripe_connect/callback. At this point I get a 404.
I dont understand why http://localhost:3000/users/auth/stripe_connect/callback does not match the user_omniauth_callback route.
This is what I see in the console:
I was able to get past the issue by manually adding the routes to route.rb:
Why did the callback route did not match until I added those routes manually?