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

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("/"));
};