Our app is getting rejected for an Internal Server Error that is originating from the `koa-shopify-auth` library (latest version) that we're using for the OAuth process when a merchant installs our app. The only way we can reproduce the problem is if we wait 60 seconds after beginning installation before completing the OAuth process, which causes the token to expire. The `koa-shopify-auth` library as well as the main `@shopify/shopify-api` library both handle this scenario by directly responding with a 500 Internal Server Error, rather than letting the developer handle the scenario appropriately. See https://github.com/Shopify/shopify-node-api/issues/130 and https://github.com/Shopify/koa-shopify-auth/issues/88.
Ideally, we'd be able to detect the error (say, catch an exception) and handle it gracefully by redirecting the client to restart the auth process. Based on the 2 issues above, I know I'm not alone in this situation. How have others worked around this? Do I just need to fork `koa-shopify-auth` and handle it myself or is there an existing workaround I can implement that will let me redirect when the token expires?
I will say it's pretty frustrating that Shopify is rejecting our app for a behavior that is intentionally baked into their official library.
One of the issues you referenced looks like it was resolved in the most recent library version. Can you try updating and see if you still encounter this issue.