kinde-oss / kinde-auth-nextjs

Kinde NextJS SDK - authentication for server rendered apps
https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/
MIT License
157 stars 24 forks source link

Bug: getting logged out as soon as I log in... #206

Closed ndaden closed 2 months ago

ndaden commented 2 months ago

Prerequisites

Describe the issue

Hi,

I'm using Kinde for NextJS, my issue is : when I click on the login button, I get redirected to post-login url then I get logged out automatically. When I check network tab, I found calls to logout routes that I never called.

image

So I end up logged out as soon as I login.

I spent a lot of time searching why this happens, but I couldn't find anything.

This only happens once app is deployed on Vercel, everything works fine on http://localhost:3000

Library URL

https://github.com/kinde-oss/kinde-auth-nextjs

Library version

2.3.1

Operating system(s)

Windows

Operating system version(s)

Windows 11

Further environment details

No response

Reproducible test case URL

No response

Additional information

No response

ndaden commented 2 months ago

I close the issue since it's working correctly when I use Kinde Login and Logout components. The issue happens when I use links to "/api/auth/login" and "/api/auth/logout"