401 Unauthorized issue at /api/auth/me!

Continuing the discussion from Nextjs-auth0 - 401 Error when not logged in?:

I am having the same issue with 401 Unauthorized on “http://localhost:3000/api/auth/me” on the browser. Any solution will be really helpful.

I’m having the same problem, i have been searching for a solution for the past few days came up with nothing

did u ever find a solution for this ?

Hey there @jack6!

This is expected behavior - The front end uses /api/auth/me endpoint to check if the user is authenticated or not (401 = logged out, 200 = logged in). You could technically adjust the profile handler to not return 401, but this would also require you to write your own front end code to get the user sessions since the useUser hook expects that API to respond with a 401 if the user is unauthenticated.

Given this has surfaced multiple times already, I definitely recommend creating a feedback request as our product team monitors these for community engagement.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.