Major bug fix

This commit is contained in:
AndrewTrieu
2023-03-10 16:41:57 +02:00
parent 4c8e7e8588
commit 0fab2411ee
19 changed files with 965 additions and 19 deletions

View File

@@ -0,0 +1,14 @@
import * as authService from "../services/authService.js";
const userMiddleware = async (context, next) => {
const user = await context.state.session.get("user");
if (user) {
const userFromDatabase = await authService.findUser(user.email);
context.user = userFromDatabase[0];
}
await next();
};
export { userMiddleware };