Your code looks like your calling your node instance, not the Auth0 /v2/logout endpoint
Here is some code, hope it helps!
/* LOGOUT ROUTER */
router.get('/logout', (req, res) => {
req.logout();
if (req.session) {
req.session.destroy(function (err) {
if (err) {
console.log(err)
}
console.log("Destroyed the user session on Auth0 endpoint");
res.redirect('https://<myapp>.auth0.com/v2/logout?client_id=<clientId>&returnTo=http://localhost:3000/');
});
}
});
Also, make sure your returnTo address is in your applications configuration under “Allowed Logout URLs” This tells the endpoint its allowed to redirect your users to the given address.
Best of Luck!