I’ve got my nextjs app up and running with the nextjs-auth0 SDK, including route protection and RBAC validation on the client.
I have pages users are allowed to view when not logged in, and I conditionally show UI based on that state by calling useUser()
and seeing if I get a user
back. However, every useUser()
call made when the user isn’t logged in results in an error in the browser console:
GET http://localhost:3000/auth/profile 401 (Unauthorized)
I see someone opened an issue about this in… 2022. Is it still really the only way to check for a logged in user?