aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/logout/+page.server.js
blob: 60750dfaa2dda166bc94e31777859f8ae2a39c15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { redirect } from "@sveltejs/kit";

const opts = {
  expires: new Date(0),
  path: "/",
};

export async function load({ cookies }) {
  cookies.set("username", "", opts);
  cookies.set("token", "", opts);
  throw redirect(307, "/login");
}