After searching the web, I found there are many posts and modules help parse bearer token, but I didn't found any help create one.
How should I properly generate a bearer token in node.js server?
You can use jwt.io token. To generate a token check out jsonwebtoken module.
You can generate a token like this:
let token = jwt.sign({
exp: Math.floor(Date.now() / 1000) + (60 * 60),
data: 'foobar'
}, 'secret');
There are plenty other examples in the docs.
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