node-persist icon indicating copy to clipboard operation
node-persist copied to clipboard

Question: stored keys are shared across users?

Open venkatkonjeti opened this issue 6 years ago • 1 comments

I am using node-persist module in my application to store the tokens.

setItemSync("userResourceToken", "someToken...")

As per understanding this token will be shared across multiple sessions. Is that right?

If above question is true, then to separate the token for every user should I store the user specific token with unique key? In this case server storage is an option or should I choose the any db for this purpose?

venkatkonjeti avatar Oct 17 '18 21:10 venkatkonjeti

you need to use unique keys per user if you want to do that.

setItemSync("userResourceToken-" + userId, "someToken...")

akhoury avatar Oct 19 '18 07:10 akhoury