0.1.2 • Published 8 years ago

@revolttv/authorized-middleware v0.1.2

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
8 years ago

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'); });