From ca362d798b7a89dfb0b334d8540c30540ed3d897 Mon Sep 17 00:00:00 2001 From: joseferben Date: Sun, 13 Oct 2024 11:01:45 +0200 Subject: [PATCH] fix: undo redirect with context --- plainstack/src/auth.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/plainstack/src/auth.ts b/plainstack/src/auth.ts index b91db22..9f8c8a6 100644 --- a/plainstack/src/auth.ts +++ b/plainstack/src/auth.ts @@ -14,7 +14,6 @@ export function protect({ session?: Session; }; }>(async (c, next) => { - if (c.get("user")) return c.redirect(signinPath); const userId = c.get("session")?.get("user-id") as string | undefined; if (!userId) return c.redirect(signinPath); const user = await getUser(userId); @@ -37,7 +36,6 @@ export function signin({ session?: Session; }; }>(async (c, next) => { - if (c.get("user")) return c.redirect(protectedPath); const userId = c.get("session")?.get("user-id") as string | undefined; const user = userId ? await getUser(userId) : undefined; if (user) return c.redirect(protectedPath);