-
Notifications
You must be signed in to change notification settings - Fork 69
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
valid_site? fails on 2.0.0 #72
Comments
Hi Joe, A bit of background: there was a lot of confusion in our codebase around this, All we do in |
I think 2.0 released assuming everybody is using the shopify_app gem. This currently does not work for a regular omniauth request. Reverting back to 1.2.1 fixes the problem |
Is there any update or workaround on this issue? I had to revert to 1.2.1 as well, however even that seems to have stopped working in Safari today. |
Safari issue might be related to this #43 Users signing up gets redircted to /auth/failure?message=csrf_detected&strategy=shopify |
I'm using sinatra and ran into similar issue when upgraded, just added
to the route which receives install redirect |
Looking at source code of Instead, we need to read the option :setup, proc { |env|
request = Rack::Request.new(env)
site = if request.params['shop']
"https://#{request.params['shop']}"
else
''
end
env['omniauth.strategy'].options[:client_options][:site] = site
} That's basically what the I'll create a PR in the next couple of days. Edit: Just realized that this is basically the code in v1.2.1 |
To anyone else having this issue I had to update my OmniAuth config to include this:
|
2.0.0 broke the shopify omniauth feature in my app and I had to downgrade back to 1.2.1. As I've seen in some other threads, the
valid_site?
method is returning false because of the change to how theshop
value is accessed through the session. It seems like a lot of people are using this gem in conjunction withshopify_app
, which I'm not. I'm using Devise and the devise initializer instead of the omniauth initializer to provide the keys and set the scopes we want to request.When I inspect the values incoming to
omniauth/strategies/shopify.rb#valid_site?
I find my shop value instrategy.session['omniauth.params']['shop']
and nothing in strategy.session['shopify.omniauth_params']. I'm not sure what is setting this session value or how to tweak it in my code to provide it in the way the that 2.0.0 change expects. Any insight? ThanksThe text was updated successfully, but these errors were encountered: