webcompile/src/hooks.server.ts

27 lines
574 B
TypeScript
Raw Normal View History

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