Intermittent random 401s

Hello, I have a shopify app. The setup is simple, using react-router template app, but when calling await shopify.authenticate.admin(request) for some users it returns 401 randomly.

Error is really irregular and there’s no specific pattern I can spot. When this happens it just falls-back to this blank 401 Unauthorized page.

Any tips how to avoid, retry on this or fix it? The only thing I spotted that it’s way worse for users using safari browser, but that’s not exclusive.

Hi @Rokas_Va

This sounds similar to this recent issue that was caused by an “nbf” claim timestamp check failing:

If your server’s clock is off by even 1-2 minutes, token validation will fail randomly.