Closed elioncho closed 5 days ago
Hey @elioncho,
Looks like it's redirecting to your login path - http://localhost:3000/login
,
However, the shopify_app
should redirect you to ShopifyApp.configuration.login_url, which in most cases SHOULD be http://localhost:3000/api/auth
and SHOULD route you to ShopifyApp::SessionController to 'login'...
Can you tell me what your ShopifyApp.configuration.login_url
set to? I'm wondering if you're routing it to a /login
controller that is using a AuthenticatedController
..
ShopifyApp.configuration.login_url
returns
"/login"
But I am not setting up the login_url anywhere. Isn't login the default path?
Every route that I open without the shop param triggers the same error.
This PR was opened to fix the issue: https://github.com/Shopify/shopify_app/pull/1868
@zzooeeyy What should login_url
be set to? Same with @elioncho , we don't customize login_url
in shopify_app.rb
, so the default is returned:
ShopifyApp.configuration.login_url
=> "/login"
We are unable to use EnsureAuthenticatedLinks since return_to
returns nil
Issue summary
Before opening this issue, I have:
shopify_app
version: 22.2.1log_level: :debug
in my configuration, if applicableWhen the user tries to open a URL without the shop param, the app attempts to redirect the user to the login page, but then a MissingJwtTokenError is triggered. I am using the token_exchange configuration. All my controllers are a subclass of AuthenticatedController.
authenticated_controller
home_controller is my root path
Expected behavior
The login page should be rendered
Actual behavior
ShopifyAPI::Errors::MissingJwtTokenError is raised and the login page is not rendered.
Steps to reproduce the problem
Debug logs
See that the redirect to the login page is made but then a MissingJwtTokenError error is triggered