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?
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.