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