mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
11 lines
403 B
TypeScript
11 lines
403 B
TypeScript
|
|
import type { RequestHandler } from "@sveltejs/kit";
|
||
|
|
import { lucia } from "$lib/server/auth";
|
||
|
|
|
||
|
|
export const GET: RequestHandler = async ({ request }) => {
|
||
|
|
if (request?.headers?.get('Authorization') === `Bearer ${process.env.CRON_SECRET}`) {
|
||
|
|
await lucia.deleteExpiredSessions();
|
||
|
|
return new Response('Success', { status: 200 });
|
||
|
|
} else {
|
||
|
|
return new Response('Unauthorized', { status: 401 });
|
||
|
|
}
|
||
|
|
}
|