Skip to content

Commit

Permalink
fix: undo redirect with context
Browse files Browse the repository at this point in the history
  • Loading branch information
joseferben committed Oct 13, 2024
1 parent 0182272 commit ca362d7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions plainstack/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function protect<User>({
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);
Expand All @@ -37,7 +36,6 @@ export function signin<User>({
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);
Expand Down

0 comments on commit ca362d7

Please sign in to comment.