BadRequestError: checks.state argument is missing - login after logout

Hello, I have a node backend with a React frontend. I´m using express-openid-connect with Auth0 for authentication. Sometimes, when the users logs out and then logs in they find this error:

‘’‘BadRequestError: checks.state argument is missing
at callbackStack (/home/node/node_modules/express-openid-connect/middleware/auth.js:109:31)
at process._tickCallback (internal/process/next_tick.js:68:7)’’’

It happends in development and production, with all IDPs ( Gmail and Outlook). And I see that the user succesfully login and logout from the Auth0 Dashboards.

Any ides why this is happening?

The problem was a middleware in express routes that set the cache-control header of the /callback. I now know that the express-openid-connect calls should not be cache.

1 Like

Perfect! Thanks for sharing it with the rest of community!