Skip to content

Commit f2362e3

Browse files
committed
bug fix
1 parent 77fcd9e commit f2362e3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/routes/logout.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export function getLogoutHandler(
2323
const session = await authRequest.validate();
2424
if (session) {
2525
auth.invalidateSession(session.sessionId);
26-
const headers = {
27-
Location: logoutAfterPath,
28-
}
2926

30-
setCookie(headers, { name: "auth_session", value: "", httpOnly: true, path: "/", maxAge: -1 });
27+
const headers = new Headers(
28+
{
29+
Location: logoutAfterPath,
30+
}
31+
);
32+
33+
setCookie(headers, { name: "auth_session", value: "", httpOnly: true, path: "/", maxAge: 0 });
3134

3235
return new Response("Unauthorized", {
3336
status: 302,

0 commit comments

Comments
 (0)