Hello, I have a potentially silly issue, but it’s driving me up the wall.
I have created a new application on auth0 and I am trying to get login/logout to work, I am using next.js, and i followed the quickstart tutorial and it all works okay, until i get to the logout. When in the “allowed logout urls” i put localhost:3000 it works fine, but since that’s also where my main app is, I can’t distinguish if i have been logged off or not, it mostly just looks like I refreshed the page.
So to test if the logout is actually working, i created a simple “test-logout” page so “http://localhost:3000/test-logout page”, and on logout i expect to be sent there, modified the allowed urls accordingly and my href on logout in my app is still simply “/api/auth/logout” ( i also tried returnTo argument with no improvements).
Now it’s falling over, and it is not taking me to the test-logout page, so I don’t know if I missed something or doing something wrong?
This is the error I get: “GET https://MydomainNAME.eu.auth0.com/v2/logout?client_id=xxxxxxxxxxxxxxx&returnTo=http%3A%2F%2Flocalhost%3A3000 400 (Bad Request)”
(it doesn’t even mention my “/test-logout” in the URL either which I find odd)
this is my href:
Logout
and this my routes.ts file:
// app/api/auth/[auth0]/route.js
import { handleAuth } from '@auth0/nextjs-auth0';
export const GET = handleAuth();
BTW the login works fine, that’s why I’m so confused. Any help would be very appreciated!! Thanks