do i need both online and offline token?

dipeshbeckham
Shopify Partner
13 0 1

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)