5 ms·
One big problem we have with shopify is users don't stay logged in for more than 24 hours. Do you guys fix that with hydrogen?
by savrajsingh 4y ago
One big problem we have with shopify is users don't stay logged in for more than 24 hours. Do you guys fix that with hydrogen?
- davecyen 4y agoYou can use hydrogen and the storefront api to renew the customerAccessToken: https://shopify.dev/api/storefront/2022-04/objects/customeraccesstoken https://shopify.dev/api/storefront/2022-04/objects/customera...
- savrajsingh 4y agoThanks for the reply. The scenario is a customer logs in. They come back 4 days later, and we want them to remain logged in and not have to re-login. According to this mutation, you must renew the access token before it expires (presumably for just another 24 hours). So I don't think this solves the issue -- we want users to stay logged in for more than 24 hours -- aka logged in for like a month by checking a "keep me logged in" box. https://shopify.dev/api/storefront/2022-04/mutations/customerAccessTokenRenew https://shopify.dev/api/storefront/2022-04/mutations/custome... What is the strategy for this basic use case?
- davecyen 4y agoJust learned that the token lasts for 6 weeks, so the issue might lie in how you’ve implemented the session. Take a look at the hydrogen demo store, auth is implemented using the customer access token and Hydrogen’s CookieSessionStorage: https://hydrogen.new https://hydrogen.new