16 lines
498 B
TypeScript
16 lines
498 B
TypeScript
import { apiBaseUrl } from "$lib/components_custom/consts";
|
|
import { redirect } from "@sveltejs/kit";
|
|
|
|
export async function load({ cookies }) {
|
|
const auth = await (await fetch(apiBaseUrl + "/v3/auth", {
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'x-api-key': cookies.get("authToken") || ""
|
|
}
|
|
})).json();
|
|
|
|
/*if (!auth.admin && !auth.moderator) {
|
|
throw redirect(303, '/401');
|
|
}*/
|
|
console.log("WARNING: Admin Auth Check is disabled! DO NOT USE IN PRODUCTION")
|
|
}
|