Public app keeps loading (node.js and React)

Shubhamf22
New Member
3 0 0

Hi everyone,

I have created an app that is continuously loading after installation. Added my server.js code below:

Would anyone know the reason for the continuous loading of the app? Any help is appreciated.

 

Thanks in advance.

 

 

import createShopifyAuth, { verifyRequest } from "@shopify/koa-shopify-auth";
....

app.prepare().then(() => {
  const server = new Koa();
  const router = new Router();
  server.use(bodyParser());

  server.use(
  session(
  {
  sameSite: "none",
  secure: true,
  },
  server
  ) );
 server.keys = [SHOPIFY_API_SECRET];
 server.use(
    createShopifyAuth({
    apiKey: SHOPIFY_API_KEY,
    secret: SHOPIFY_API_SECRET,
    scopes: [SCOPES],

    async afterAuth(ctx) {
    const { shop, accessToken } = ctx.session;
    ctx.cookies.set("shopOrigin", shop, {
    httpOnly: false,
    secure: true,
   sameSite: "none",
   });
   ctx.redirect("/");
}
})
);

 

0 Likes