Skip to content

Commit ca362d7

Browse files
committed
fix: undo redirect with context
1 parent 0182272 commit ca362d7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

plainstack/src/auth.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function protect<User>({
1414
session?: Session;
1515
};
1616
}>(async (c, next) => {
17-
if (c.get("user")) return c.redirect(signinPath);
1817
const userId = c.get("session")?.get("user-id") as string | undefined;
1918
if (!userId) return c.redirect(signinPath);
2019
const user = await getUser(userId);
@@ -37,7 +36,6 @@ export function signin<User>({
3736
session?: Session;
3837
};
3938
}>(async (c, next) => {
40-
if (c.get("user")) return c.redirect(protectedPath);
4139
const userId = c.get("session")?.get("user-id") as string | undefined;
4240
const user = userId ? await getUser(userId) : undefined;
4341
if (user) return c.redirect(protectedPath);

0 commit comments

Comments
 (0)