-
Notifications
You must be signed in to change notification settings - Fork 695
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
Migrating from shop-based to user-based token strategy #1837
Comments
Hey @tarekrahme, I'm sorry to hear about this issue you have encountered. I tried to reproduce this on my end with a new app created from the Shopify ruby template app to migrate from shop based to user based sessions and I wasn't able to reproduce problem. But here are some more debugging solutions to get more insight into the issue -
# config/initializers/shopify_app.rb
ShopifyAPI::Context.setup(
#.......
log_level: :debug,
) |
I implemented User Session on my app. shopify_app gem version 21.2.0 and shopify_api gem 12.2.0. I was able to configure this correctly. While using the shopify_app gem version 21.10 and shopify_api version 13.4.0, I got the same problem. (Corrected) |
Hey @zzooeeyy |
Hey @UmerQaisar |
@zzooeeyy My app is non-embedded. Would that cause an issue with that migration? What checks can I make to check if the cookies are set correctly? |
@zzooeeyy In my gem version (21.10.0) the callback method is:
The issue is happening in
In fact
etc.. you get the idea. So it gets in this loop 3 times with I dug into the method
And
In my case session[:shopify_user_id] is nil So this method is always returning true Do you have any clue about what is not behaving as expected? Maybe session[:shopify_user_id] should not be nil? Thanks so much! |
Hey @tarekrahme --
|
Hey @zzooeeyy The issue has disappeared with shopify_app gem version 21.2.0 |
I'll add this to our backlog and take a look when we get a chance. Thanks! |
Issue summary
Before opening this issue, I have:
shopify_app
version: 21.10Ruby version: 3.3.0
Found a reliable way to reproduce the problem that indicates it's a problem with the package
Looked for similar issues in this repository
Checked that this isn't an issue with a Shopify API
I am moving an existing app with existing shops using the app from shop-based token to user-based token
I followed the 3 steps listed here: https://github.com/Shopify/shopify_app/blob/main/docs/shopify_app/sessions.md#migrating-from-shop-based-to-user-based-token-strategy
My belief is that it means I keep shops and users at the same time
When I try to install the app I see multiple OAuth attempts in my logs (goes to '/login?host...' then '/auth/shopify/callback?...' multiple times in a row)
Then the webpage shows an error mentioning too many redirects and I am taken back to Shopify Admin and shown an error message that an error occurred with the app
Expected behavior
App is installed / open / goes through OAuth, and user is created or found in the app db (same as what happens with shops basically)
Actual behavior
Error message, multiple OAuth attempts / redirects (as described above)
Steps to reproduce the problem
Debug logs
The text was updated successfully, but these errors were encountered: