@revolttv/authorized-middleware
v0.1.2
Published
Middleware to check if the incoming request has appropriate authorization
Downloads
4
Readme
authorized-middleware
Checks an incoming request to see if the user has the appropriate roles
Throws an error if no req.user
object exists
Usage
import authorized from '@revolttv/authorized-middleware';
let app = new express();
app.use(authorized(['role', 'otherRole']));
app.get('/single-role', authorized('single'), (req, res) => { res.send('ok'); });