Skip to content

Instantly share code, notes, and snippets.

@Harasz
Created September 1, 2021 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Harasz/ec8bcf09fb1db1497301c6cfc2bbc6bc to your computer and use it in GitHub Desktop.
Save Harasz/ec8bcf09fb1db1497301c6cfc2bbc6bc to your computer and use it in GitHub Desktop.
router.get("/settings", async (ctx) => {
const session = await Shopify.Utils.loadCurrentSession(ctx.req, ctx.res);
const shop = session.shop;
// This shop hasn't been seen yet, go through OAuth to create a session
if (session === undefined || ACTIVE_SHOPIFY_SHOPS[shop] === undefined) {
ctx.redirect(`/auth?shop=${shop}`);
return;
}
ctx.status = 200;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment