Can't logout using /api/auth/[kindeAuth]/route.ts
I'm currently using the NextJS SDK for implementing Kinde. Everything has been going great, but I have one problem: I can login and authenticate just fine. But I'm unable to log out of my app.
A few notes:
1. I'm testing on localhost (haven't tried in production, because we're not ready to go live yet).
2. I've set up all my environmental variables including both KINDE_POST_LOGOUT_REDIRECT_URL and NEXT_PUBLIC_KINDE_POST_LOGOUT_REDIRECT_URL
3. I added the KINDE_POST_LOGOUT_REDIRECT_URL to my next.config.mjs file, along with the other variables that are listed in the help docs
4. The logout redirect url is my Kinde instance (https://****-development.uk.kinde.com)
5. In my app, I have a link that calls: redirect(
6. I've set up the api route in /api/auth/[kindeAuth]/route.ts (following this guide: https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#install-for-an-existing-project)
7. If I click on the link, it just refreshes my page and I'm still logged in. It doesn't even try to redirect me to my Kinde instance
Not sure what I'm doing wrong?
A few notes:
1. I'm testing on localhost (haven't tried in production, because we're not ready to go live yet).
2. I've set up all my environmental variables including both KINDE_POST_LOGOUT_REDIRECT_URL and NEXT_PUBLIC_KINDE_POST_LOGOUT_REDIRECT_URL
3. I added the KINDE_POST_LOGOUT_REDIRECT_URL to my next.config.mjs file, along with the other variables that are listed in the help docs
4. The logout redirect url is my Kinde instance (https://****-development.uk.kinde.com)
5. In my app, I have a link that calls: redirect(
/api/auth/logout?post_logout_redirect_url=https://${process.env.NEXT_PUBLIC_KINDE_POST_LOGOUT_REDIRECT_URL} ) using the redirect function from next/navigation6. I've set up the api route in /api/auth/[kindeAuth]/route.ts (following this guide: https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#install-for-an-existing-project)
7. If I click on the link, it just refreshes my page and I'm still logged in. It doesn't even try to redirect me to my Kinde instance
Not sure what I'm doing wrong?
Kinde docs
Our developer tools provide everything you need to get started with Kinde.
