Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hey guys,
I may be overlooking this but I was wondering where I can find the default expiration date for customerAccessTokens? I think I stumbled upon it once but I can't seem to find it again the documentation. Also, is there a way to generate an access token while declaring our own expiration date?
I plan on referencing my JWT's with an id in localStorage and I want to refresh them as much as possible (refresh on page render and ideally, after 10 minutes). Since I am using localStorage, cycling the JWTs on the client side is an absolute must.
I'm not very familiar with this API but isn't the expiration date on the object itself alongside the access token? Is this the customerAccessToken you are referring to?
yes lol I have repeatedly used the token alone so many times in development, I forgot the intial response included the expiry. That's called a brain fart. Now, can I shorten it is the question?
I'm not sure. You mean request a new one and expire the old one ?
No, I mean setting the default expiry time when you generate a new token. You can simply renew a token whenever you want, so there is a lot of control that can come from that. I was just curious if we could set our own expiry parameters.
sorry for pinging you after 2 years - but did you find any solution to this problem (of setting our own token expiry time)??