mirror of
https://github.com/open-reception/appointment-booking-software.git
synced 2026-09-05 17:17:38 +02:00
Remove auth cookie only after logout call to api
This commit is contained in:
@@ -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 } };
|
||||
|
||||
Reference in New Issue
Block a user