Copy project from personal website
This commit is contained in:
2026-03-17 13:41:37 +01:00
commit 8e1df92813
29 changed files with 1989 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { type NextFunction, type Request, type Response } from "express";
import userModel, { values } from 'backend/models/userModel';
function checkAuthenticated(req: Request, res: Response, next: NextFunction) {
const pass = req.body.pass;
const password = userModel.getValue(values.pass);
if (pass && password) {
if (pass == password) {
return next();
}
}
return res.status(500).json({ message: 'Error when getting transactions.' });
}
export default checkAuthenticated;