Shopify / koa-shopify-auth

DEPRECATED Middleware to authenticate a Koa application with Shopify
MIT License
80 stars 64 forks source link

Cookies on domain causing infinite loop ? #156

Closed psppro26 closed 2 years ago

psppro26 commented 2 years ago

Hello, i'm using Tawk.to chat app on my shopify app,so basically the app is adding a cookie to follow customers.

Right now i have an issue with the auth of my shopify embedded app, who get a loop when i'm restarting my node server !

Capture d’écran 2022-03-10 à 18 14 24

I know it's due to that cookie , cause when i remove it, it's instant work and redirect perfectly , then it's working until i restart the node server.

I tried on Safari / Firefox and it's working perfectly , issue is only on Google Chrome !

any idea why is it happening ?

haripraneshHP commented 2 years ago

I'm facing the same issue. Anyone have solution for this?

gokulakkrishnan commented 2 years ago

I'm facing the same issue. Anyone have solution for this?

psppro26 commented 2 years ago

Found a solution by myself :-) Basically just remove every cookies who's conflicting on client side ;-)

router.get("/", async ctx => {
    const shop = ctx.query.shop;

    ctx.cookies.set("cookieNAME", "", {
          httpOnly: false,
          secure: true,
          sameSite: "none",
          domain: ".domain.com"
        });
        ctx.cookies.set("cookieName", "", {
          httpOnly: false,
          secure: true,
          sameSite: "none"
        });
daviareias commented 2 years ago

I get this bug when I put the verifyRequest middleware in the (".*") route :/