I have used shopify-cli to bootstrap the app. In the server.js file the app uses ACTIVE_SHOPIFY_SHOPS object to verify if a session already exists,
I don’t understand the need for this check, why not just check the session storage(Redis etc.) if a session exists and the session is not expired.
router.get("/", async (ctx) => {
const shop = ctx.query.shop;
// This shop hasn't been seen yet, go through OAuth to create a session
if (ACTIVE_SHOPIFY_SHOPS[shop] === undefined) {
ctx.redirect(`/auth?shop=${shop}`);
} else {
await handleRequest(ctx);
}
});