Remove auth cookie only after logout call to api

This commit is contained in:
Karl Ludwig Weise
2026-05-05 11:59:55 +02:00
parent ad9e49e3cf
commit f833dbf500
+3 -7
View File
@@ -1,14 +1,8 @@
import { removeAuthCookies } from "$lib/server/utils/cookies";
import { auth } from "$lib/stores/auth";
import type { PageServerLoad } from "./$types";
export const load: PageServerLoad = async (event) => {
event.cookies.delete("access_token", {
path: "/",
httpOnly: true,
secure: true,
sameSite: "strict",
});
const success: Promise<boolean> = event
.fetch("/api/auth/logout", {
method: "POST",
@@ -21,6 +15,8 @@ export const load: PageServerLoad = async (event) => {
return resp.status < 400;
});
removeAuthCookies(event);
auth.reset();
return { streaming: { success } };