p5.js-web-editor/server/utils/isAuthenticated.js

12 lines
237 B
JavaScript
Raw Permalink Normal View History

export default function isAuthenticated(req, res, next) {
if (req.user) {
2018-01-09 21:21:40 +00:00
next();
return;
}
res.status(403).send({
success: false,
message: 'You must be logged in in order to perform the requested action.'
});
}