Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

do i need both online and offline token?

do i need both online and offline token?

dipeshbeckham
Shopify Partner
13 0 2

I have created one public app using `@Shopify/koa-shopify-auth V^5.0.3` and encounter issue about tokens

 

When i use only offline token app does not seems to be installed on store, and when i add online token then app installation works, now issue is when online token expired it redirect customer to reauthenticate, i understand that is how it supposed to, but client do not want such redirection and think it is not correct.

 

Am i missing anything? below is the code i am using for online and offline token

server.use(
  shopifyAuth({
    accessMode: "offline",
    prefix: "/install",
    async afterAuth(ctx) {
      const { shop, accessToken, scope } = ctx.state.shopify;
      const host = ctx.query.host;

      ctx.redirect(`/auth?shop=${shop}&host=${host}`);
    },
  })
);

server.use(
  shopifyAuth({
    async afterAuth(ctx) {
      const { shop, accessToken } = ctx.state.shopify;
      const host = ctx.query.host;

      ctx.redirect(`/?shop=${shop}&host=${host}`);
    },
  })
);

so what is the possible solution?

Replies 0 (0)