Skip to content

Commit

Permalink
fix: infinite redirect loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Zuniga Cuellar committed Oct 20, 2023
1 parent c3a61df commit 7d8e751
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export const onRequest = defineMiddleware(
});

if (error) {
cookies.delete("sb-access-token", {
path: "/",
});
cookies.delete("sb-refresh-token", {
path: "/",
});
return redirect("/signin");
}

Expand Down

0 comments on commit 7d8e751

Please sign in to comment.