assertBearerToken

This val can be used to assert that a valid bearer token exists and has been signed by the secret provided.

Example

const handler = (req, res) => { const authorization = req.get('authorization'); // throws if invalid const token = @neverstew.assertBearerToken(@me.secrets.superSecret, authorization); res.json(token); }