mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
14 lines
472 B
TypeScript
14 lines
472 B
TypeScript
import { text } from "@sveltejs/kit";
|
|
import { authorize } from "$lib/server/modules/auth";
|
|
import { logout } from "$lib/server/services/auth";
|
|
import type { RequestHandler } from "./$types";
|
|
|
|
export const POST: RequestHandler = async ({ locals, cookies }) => {
|
|
const { sessionId } = await authorize(locals, "any");
|
|
|
|
await logout(sessionId);
|
|
cookies.delete("sessionId", { path: "/" });
|
|
|
|
return text("Logged out", { headers: { "Content-Type": "text/plain" } });
|
|
};
|