Skip to content

Instantly share code, notes, and snippets.

@ardeearam
Created July 13, 2020 02:39
Show Gist options
  • Select an option

  • Save ardeearam/57321792df831c7a6ce907dbfa9c055e to your computer and use it in GitHub Desktop.

Select an option

Save ardeearam/57321792df831c7a6ce907dbfa9c055e to your computer and use it in GitHub Desktop.
Shopify Auth - Before Billing Code
server.use(
createShopifyAuth({
apiKey: SHOPIFY_API_KEY,
secret: SHOPIFY_API_SECRET,
scopes: [SCOPES],
async afterAuth(ctx) {
//Auth token and shop available in session
//Redirect to shop upon auth
const { shop, accessToken } = ctx.session;
ctx.cookies.set("shopOrigin", shop, {
httpOnly: false,
secure: true,
sameSite: "none"
});
ctx.redirect("/");
}
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment