KindeK
Kinde9mo ago
2 replies
Ricer

Random error when trying to authenticate - ExpressJS backend with DynamoDBStore + React frontend

I'm running a REST API with an ExpressJS that runs kinde-node-express with a DynamoDBStore and a React frontend.

The login process is simply the frontend href to the /login route of my backend, which then handles the the entire flow (sends the user to kinde's authentication flow, and then redirects back to my backend). I can't seem to go past the protectRoute function - not sure if validateToken fails or what.

The main issue is that this occurs "randomly" when I make changes to my frontend and then try to login or when I logout from 1 user and login from a different user from the same browser. This doesn't happen all the time, so I can't pinpoint the problem & reproduce the bug consistently.

Moreover, sometimes when I try to login and it doesn't work, it will work after a few more times, sometimes 1 more time and sometimes 4-5 more times.
Another thing I noticed is that it could also work if I restart my backend (which is a very bad solution by the way).

Is this problem known? Was there a fix at later version of kinde-node-express or its dependencies? I'm currently using version 1.6.0 and jwt-validator is 0.1.0
Was this page helpful?