mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-04-07 09:36:52 -05:00
19 lines
372 B
JavaScript
19 lines
372 B
JavaScript
const common = require('../helpers/common');
|
|
|
|
function authenticationRequired(req, res, next) {
|
|
if (req.isAuthenticated()) {
|
|
return next();
|
|
} else {
|
|
console.log('sending auth error');
|
|
common.sendApiAuthError(req, res);
|
|
}
|
|
}
|
|
|
|
function authenticationOptional(req, res, next) {
|
|
return next();
|
|
}
|
|
|
|
module.exports = {
|
|
authenticationRequired,
|
|
authenticationOptional
|
|
}; |