For backend, I’m running python/flask using ShopifyAPI module to decode and authenticate the session_token.
shopify.session_token.decode_from_header(...)
I get a weird error MOST of the time:
shopify.session_token.SessionTokenError: The token is not yet valid (nbf)
It appears the time window of validity is in the FUTURE. Sure enough, if I sleep a little bit, it works with increasing frequency the longer I sleep. If I have my python code sleep 0.5 or 1 second it works sometimes but not always. If I have my python code sleep 3 seconds, it usually works. But of course, I don’t want to purposefully make my code slow.
What is going on here? Is it just that my computer’s time is a few seconds behind Shopify’s servers’ time? Should I just go ahead and wait 3 seconds? Should I use jwt to decode manually to check the nbf value and wait as needed?