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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -