-
Notifications
You must be signed in to change notification settings - Fork 389
shopifyAuth throws 500 error if more than 1 minute between GET / and GET /auth/callback #202
shopifyAuth throws 500 error if more than 1 minute between GET / and GET /auth/callback #202
Comments
Anyone interest in this? |
Any update on this? |
Hey @louiscollarsmith, this is actually working as intended - we use that limit so that we don't have 'hanging' sessions that could be abused. There was a longer discussion on this topic, but essentially the cookie that's used for the OAuth session will expire after that 1m period. |
@paulomarg Ok makes sense. So how do i handle this. Currently my server just throws a 500. |
Sorry, forgot to mention that - if you get this error you could just retry the OAuth process (i.e. redirect the user to |
how programatically should i catch the error thrown by afterAuth? |
I've applied the workaround proposed in the other issue to the source, but if you don't want to wait for a new release you could follow the instructions there! |
Great thank you! |
Version 4.1.4 is out which should fix this issue! |
Issue summary
When a user is on the "You are about to install #APP_NAME" page and they wait for more than 1 minute to click "Install app" a 500 error is thrown.
Url
GET /auth/callback?code=4e9c4cb180763a21ab0fbf243c17f5ba&hmac=751bbcaa7f5a4013575d617af11f23eb1e570c8c1f82d36a12405895404bda38&host=cXVpdmVyLWltbWVkaWF0ZS1kZWxpdmVyaWVzLm15c2hvcGlmeS5jb20vYWRtaW4&shop=quiver-immediate-deliveries.myshopify.com&state=284790218494132×tamp=1623885746
Error
This bug is difficult to recreate as installing the app on a test store, you typically don't go through the App store. This means the "You are about to install #APP_NAME" is skipped as it "Install app" is auto-clicked/auto-selected.
To understand this error better, I added
CustomSessionStorage
class with the relevant functions. The loadCallback function is never called if the time between auth is longer than 1 minute even though there is a session in the storage.This issue occurs when using the
Shopify.Session.MemorySessionStorage
andShopify.Session.CustomSessionStorage
.My relevant dependencies are:
Expected behavior
Users should be able to sit for more 1 minute idle between auth and auth callback
OR
I should be able to handle this error and restart the auth process rather than just throwing 500 error.
Steps to reproduce the problem
I have been recreating the issue via shopify.
The text was updated successfully, but these errors were encountered: