I'm using the paseto npm package for generating a secret key and further using that key to create a token.
I might be going wrong with understanding something here, how do I store the key generated?
The following is the code:
V2.generateKey("local").then(mySecret => {
let payload = {
user: req.body.user
}
V2.encrypt(payload, mySecret, {
expiresIn: '2 hours'
}).then(result => {
console.log(result);
res.json({
result
})
}).catch(err => {
console.log(err);
res.json({
error: err
})
})
})
How do I know what "mySecret" is and how to store it?