This repository has been archived on 2024-08-06. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
chellaris-sign-up-site/src/routes/admin/+page.server.ts

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")
}