Files
webcompile/src/hooks.server.ts
T

27 lines
574 B
TypeScript
Raw Normal View History

import { SvelteKitAuth } from "@auth/sveltekit"
import Authentik from '@auth/core/providers/authentik';
2022-12-31 14:14:53 +02:00
import { env } from "$env/dynamic/private";
2023-01-03 11:38:55 +02:00
import statusData from "$lib/statusData";
import map from "$lib/map";
export const handle = SvelteKitAuth({
providers: [
//@ts-ignore
Authentik({
2022-12-31 14:14:53 +02:00
clientId: env.AUTH_CLIENT_ID,
clientSecret: env.AUTH_CLIENT_SECRET,
issuer: env.AUTH_ISSUER
})
]
2023-01-03 11:38:55 +02:00
})
const updateMap = () => {
map.set("data", {
status: statusData,
updated: Math.floor(Date.now() / 1000)
});
};
updateMap();
setInterval(updateMap, 30000);