You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/src/auth/middleware.js

17 lines
343 B
JavaScript

"use strict";
const errors = require("../errors");
module.exports = {
isAuthenticated: function (req, res, next) {
if (req.session.user != null) {
next();
} else {
throw new errors.UnauthorizedError("You must be authenticated to view this page");
}
},
isAdministrator: function (req, res, next) {
/* FIXME */
next();
}
};