This commit is contained in:
AndrewTrieu
2023-03-11 18:19:16 +02:00
parent ee0936c8b1
commit f14618b7cc
16 changed files with 70 additions and 59 deletions

View File

@@ -1,8 +1,8 @@
const restrictedPaths = ["/topics", "/quiz"];
const authMiddleware = async (context, next) => {
const user = await context.state.session?.get("user");
const user = await context.state.session.get("user");
console.log(user);
if (
!user &&
restrictedPaths.some((path) =>