node.js - How to store Json Web Token in mongodb using node express -


i tried implement jwt(jsonwebtoken) node express through mongodb. in time of generating token store token value database collection , retrieve token mongodb , pass next pages , set logout option, when trigger logout the token field in database got flushed , no more actions performed after this. problem when more 1 users logged in application not possible.because when clicked logout clears tokens. how can solve correctly..?

just put req.session.token, passing token = jwt.sign();

but after authentication.

and on logout can delete req.session.token


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -