aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/authentication/log-out/+server.ts
blob: 8623dfd11c6659192471d937adf67bb86486aed5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { redirect } from "@sveltejs/kit";
import root from "$lib/Utility/root.js";

export const GET = ({ cookies }) => {
	cookies.delete("user", { path: "/" });
	cookies.set("logout", "1", {
		path: "/",
		maxAge: 60 * 60 * 24 * 7,
		httpOnly: false,
		sameSite: "lax",
		secure: false,
	});

	redirect(303, root("/"));
};