mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-30 14:07:10 +03:00
12 lines
236 B
JavaScript
12 lines
236 B
JavaScript
|
const ErrorResponse = require('../utils/ErrorResponse');
|
||
|
|
||
|
const requireAuth = (req, res, next) => {
|
||
|
if (!req.isAuthenticated) {
|
||
|
return next(new ErrorResponse('Unauthorized', 401));
|
||
|
}
|
||
|
|
||
|
next();
|
||
|
};
|
||
|
|
||
|
module.exports = requireAuth;
|