Shopify / shopify_app

A Rails Engine for building Shopify Apps
MIT License
1.76k stars 683 forks source link

EnsureAuthenticatedLinks not working? #1872

Closed netwire88 closed 3 months ago

netwire88 commented 3 months ago

Issue summary

The documentation for EnsureAuthenticatedLinks is a bit unclear how to use it, or it could be a bug. When we enter a URL to the app, shopify_app redirects to login_url. The user then needs to enter their myshopify URL (which apparently Shopify app review team is not allowing anymore), and then when it redirects back to the app return_to is now nil. It was in ShopifyApp::EnsureAuthenticatedLinks#redirect_to_splash_page but not anymore

Before opening this issue, I have:

Expected behavior

  1. Go to https:///deep_link_url which implements EnsureAuthenticatedLinks
  2. Should authenticate and redirect back to app with return_url = /deep_link_url

Actual behavior

  1. Redirect back to app with return_url = nil
matteodepalo commented 3 months ago

Hi @netwire88, thank you for opening this issue, the team will take a look.

zzooeeyy commented 3 months ago

hey @netwire88, what is your /deep_link_url? shopify_app redirects to the login page if shop or host params isn't in the requested path.

netwire88 commented 3 months ago

Thanks @zzooeeyy I think I figured it out. The deep_link_url cannot have /store/xxxx in it. Was this in the instructions somewhere? I think I missed it.