Handling Response Error in Shopify remix app

Hi, I just created a new shopify public app by following the official documentation of an app and I came across and error ‘handling response’. I opened the network tab and I get the unauthorized error as you can see in the attached photo.

I added the shopify api key, secret key and shopify app url but it is still not working

Hi there :waving_hand:

This error message, can be caused for several reasons. To get a better understanding of the specific error you can turn on debug level logging.

//shopify.server
//shopifyApp object
logger: {
   level: LogSeverity.Debug
}

This is most commonly caused because you need to sync the clock on your computer. If you clock is out of sync on your computer. This means that when we try to authenticate the JWT it will come back as expired.

To resolve this you will need to go into your computer settings and synchronize your clock.

1 Like

Yes I turned on the logger and I get this error

I did the automatic syncing but it is still not working

Facing the same issue can you please help with this

Hi.
You don’t provide much to go on but one thing i noticed. You say that you added shopify api key, secret key and shopify app url. If you spin up a remix app template you should not have to handle those manually.
If you do: shopify app init and auto url update and then shopify app dev. You should be able to see your app in your partner account. Click text your app and ad you dev store. Back to cli and do shopify app deploy. You should have an environment that works out of the box.

Hope you get it to work.

I came to the solution for this problem. You are getting the error related to "nbf" claim timestamp check failed, which means the token is not valid before the time given in the payload of your JWT.

You can check the "nbf", "iat", and "exp" values in the payload using any JWT decoder, and then check your server time. If there is a time difference, you will get this error.

Sync your system time clock or manually set the time correctly.

Is there a discrepancy between the time on your computer and the actual time.

@Faateh_Dummy @Abhishek_Thakur

Try this :

On Windows:

  1. Open Settings → Time & Language → Date & Time
  2. Enable “Set time automatically”
  3. Click “Sync now”

On macOS:

  1. Open System Settings → General → Date & Time
  2. Enable “Set time and date automatically”
  3. Make sure time zone is correct

On Linux:

bash

CopyEdit

sudo timedatectl set-ntp true
sudo timedatectl status