refactor: session handler

This commit is contained in:
Huskydog9988
2025-04-03 19:15:33 -04:00
parent a8d681f99d
commit 3a50e3ebae
13 changed files with 189 additions and 168 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ export default defineNitroPlugin((nitro) => {
switch (error.statusCode) {
case 401:
case 403:
const userId = await sessionHandler.getUserId(event);
if (userId) break;
const user = await sessionHandler.getSession(event);
if (user) break;
return sendRedirect(
event,
`/auth/signin?redirect=${encodeURIComponent(event.path)}`