Fix context

This commit is contained in:
AndrewTrieu
2023-03-10 16:52:00 +02:00
parent 0fab2411ee
commit ee0936c8b1
5 changed files with 6 additions and 714 deletions

View File

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