401 Unauthorized after a day

I have installed a custom application in my Shopify store. uses an access token for authorization. it works fine for a day. after a day with the same credentials, it return 401 unauthorized.

It gets fixed when I open my custom application from the admin panel using the Apps section on the side bar. but after a day faces the same unauthorized issue.

I used @Shopify_77 /koa-shopify-auth module for authorization.
Is there anything in the store configuration that I need to double-check? Is there something else to do to drill down on this issue?

Hey @webbrains12

Sounds like you’re using an online token - which expires after 24 hours. You’ll want to switch to an offline token instead. More info here: https://shopify.dev/docs/apps/auth/oauth/access-modes

Thanks @SBD

But Also I found Shopify had removed the ability to request offline access to the API. last updated on September 2021

That might just be for the deprecated koa package. Try the Plain JS version :slightly_smiling_face: