Adding express-jwt to API logs me out


I have a REACT app using @auth0/auth0-spa-js to call node.js backend that uses express-jwt
to check when a user hits an API endpoint if it is logged in. Problem is that as soon as I add the express-jwt middlewere I get logged out from google. (I am using my gmail as account in my app via auth0).

Example usage:
app.get(’/users’, authorizeAccessToken, function(request, response) {…}

const jwt = require(“express-jwt”);

const authorizeAccessToken = jwt({
secret: jwksRsa.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
audience: ‘http://localhost:9999’,
algorithms: [“RS256”]

In my request header I added the token from REACT:

“authorization”:“Bearer xxxxToken contentxxxxxx”

I have latest libraries and node as I just started.

Hi @pcm,

You get logged out from the React app or the express app? It doesn’t look like there is login in your express app.