Skip to content

Commit

Permalink
🐛 Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Apr 19, 2024
1 parent d6b4317 commit 0ead211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/client-ts/src/app/connections/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default function Layout({
}>) {
const { session } = useStytchSession();
const router = useRouter();
/*useEffect(() => {
useEffect(() => {
if(config.DISTRIBUTION !== "selfhost" && !session){
router.push("/b2c/login");
}
}, [session, router]);*/
}, [session, router]);

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions apps/client-ts/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ export async function middleware(request: NextRequest) {

if(request.nextUrl.pathname.startsWith('/api/logout')){
const response = NextResponse.redirect(new URL("/b2c/login", request.url));
const sessionJWT = request.cookies.get("session")?.value;
const sessionJWT = request.cookies.get("stytch_session_jwt")?.value;
if (!sessionJWT) {
return;
}
// Delete the session cookie by setting maxAge to 0
response.cookies.set("session", "", { maxAge: 0 });
response.cookies.set("stytch_session_jwt", "", { maxAge: 0 });
// Call Stytch in the background to terminate the session
// But don't block on it!
stytchClient.sessions
Expand Down

0 comments on commit 0ead211

Please sign in to comment.