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