fix: remove nested .git folders, re-add as normal directories

This commit is contained in:
2026-03-22 17:50:47 -05:00
parent f55c7e47c9
commit 6b7eec67b8
1870 changed files with 4170168 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
import { optima } from "$lib";
import type { LayoutServerLoad } from "./$types";
export const load: LayoutServerLoad = async ({ locals }) => {
const accessToken = locals.session?.accessToken ?? null;
// Only check permissions if the user is authenticated
if (!accessToken) {
return { canViewAdmin: false, user: null };
}
let canViewAdmin = false;
let user = null;
try {
const userInfo = await optima.user.fetchInfo(accessToken);
user = userInfo.data ?? null;
const permResult = await optima.user.checkPermissions(accessToken, [
"ui.navigation.admin.view",
]);
canViewAdmin = permResult?.data?.results?.[0]?.hasPermission === true;
} catch (err) {
console.error("Admin permission check or user fetch failed:", err);
canViewAdmin = false;
user = null;
}
return { canViewAdmin, user };
};