Hi,
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,
jwksUri: https://myapp.eu.auth0.com/.well-known/jwks.json
}),
audience: ‘http://localhost:9999’,
issuer: https://myapp.eu.auth0.com/
,
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.