2022-12-30 22:32:49 +05:30
|
|
|
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";
|
2022-12-30 22:32:49 +05:30
|
|
|
|
|
|
|
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
|
2022-12-30 22:32:49 +05:30
|
|
|
})
|
|
|
|
]
|
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);
|