aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/authentication/log-out/+server.ts
blob: e3ce347ae4842c6874a90b8b60635a44fd86e05f (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
	});

	throw redirect(303, root('/'));
};