Initial commit

This commit is contained in:
Lorenzo Sanesi
2026-03-26 22:46:03 +01:00
commit 18e0e04700
80 changed files with 13114 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
const config = require('../config');
module.exports = (sequelize) => {
const { User } = sequelize.models;
let MOCK_USER_ID = null;
return async (req, res, next) => {
if (!MOCK_USER_ID) {
const user = await User.findOne({
where: { name: config.MOCK_AUTH.DEFAULT_USER_NAME },
});
if (user) {
MOCK_USER_ID = user.id;
}
}
req.userId = MOCK_USER_ID;
next();
};
};