I build an App with the last version of shopify/cli and Remix.
The default code introduces a route auth.login, I don’t understand the use of this route ?
When my app is installed, if I click to the name of the app in the admin menu of my shop, I access https://admin.shopify.com/store/MY_STORE/apps/MY_APP, which shows a login Form :
How can I avoid this page ? I just want people to access my default app._index.tsx page, which shows my content.
I don’t understand, because if I change manually the URL to add for exemple: https://admin.shopify.com/store/MY_STORE/apps/MY_APP/app/dashboard, which one of my custom routes, it works.
But, https://admin.shopify.com/store/MY_STORE/apps/MY_APP/app show the same login form.
Can you explain me please ?
As far as I understand, in my route app._index.tsx, I have a redirection:
if (user) {
return redirect("/app/dashboard");
}
If I remove the redirection, the app._index.tsx is well loaded. The URL of the redirection works, I can access it directly.
Why is this redirection causes this effect ?
Did you solve the problem?
I want to go to my app/reviews/settings page by pressing a button from my app/reviews page, but the screen you mentioned appears.
I am also facing this issue but randomly.
I am also having the same problem. I get the login screen, but if I manually enter a route, it is already logged in. CAn any one explain what this page is for, and why it keeps appearing.
I found out what the issue was with my code, logging out all the time. I was using an A tag in the breadcrumb; it does not set authentication info, I had to replace it with a Link tag.
I changed the following from :
<TitleBar title="Add Product Pricing Tiers" >
<a variant="breadcrumb" href={"/app/products/"+page}>All Products</a>
<button variant="primary" onClick={()=>{ navigate('/app/products/'+page) }}>
Back to Products
</button>
</TitleBar>
To
<TitleBar title="Add Product Pricing Tiers" >
<Link variant="breadcrumb" to={"/app/products/"+page}>All Products</Link>
<button variant="primary" onClick={()=>{ navigate('/app/products/'+page) }}>
Back to Products
</button>
</TitleBar>
Plus rather than use import {redirect} from “remix-run/node”; for redirects I had to use:
const { session, admin, redirect } = await authenticate.admin(request);
This redirect includes the Shopify authentication info in the redirect, where the @remix-run/node does not.