My current project involves setting up an auth0 login flow for a node js server that serves a react app. The login and log out flows have been implemented correctly, however, I am encountering an issue with the received token on the /callback
URL.
When navigating to /login
, it successfully redirects to the Auth0 form where logging in works without any problems based on the logs from Auth0. But upon redirection back to the callback URL, a false token is being presented.
app.get("/callback", (request, response, next) => {
passport.authenticate("auth0", (auth0Error, token) => {
if (!token){
// At this point, the token is false
}
...
})(request, response, next);
});
I'm puzzled as to what could be causing this false token issue. Can anyone shed light on how the authenticate function operates within a callback and provide guidance on how to address this situation? Would attempting to authorize through auth0 again be a potential solution?