We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Shopify Remix App: Issue with shopify.authenticate.admin on Random Pages

Shopify Remix App: Issue with shopify.authenticate.admin on Random Pages

ericlee996
Shopify Partner
1 0 4

Problem Description

I am developing a Shopify Remix App, and I’m encountering an intermittent issue with the shopify.authenticate.admin() method. Occasionally, around 5% of the time, the following error occurs:

{
status: 500,
statusText: '',
internal: false,
data: "Detected call to shopify.authenticate.admin() from configured login path ('/auth/login'), please make sure to call shopify.login() from that route instead."
}

This error randomly occurs on different pages of my app where shopify.authenticate.admin() is called. It is not tied to any specific page or action. The strange part is that simply refreshing the browser resolves the issue immediately, and the app works as expected.


Hypothesis

I suspect that the issue might be related to the admin token being expired or invalid at the time the authenticate.admin function is called. This could explain why refreshing the browser resolves the problem, as it likely triggers a new session or re-validation process.

How can this issue be resolved, or are there any directions I can explore to address it?

Replies 2 (2)

an_autoserve
Shopify Partner
18 0 3

Hi @ericlee996 , I am experiencing the same problem. Did you find the solution for this?

dongtn
Shopify Partner
1 0 0

I have the same problem, has anyone earn a solution yet?