I have a nodejs as the api server and react as the web app. I only use jwt token to authenticate users and store the token in browser local storage. How do I force a user to logout?
You better store token in your server side. Then you can easily revoke or remove a token. User has to authorize or validate token each time when they use your api. If your use express session, you can just call req.session.destroy().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With