session state simplification

This commit is contained in:
Michael Freno
2026-01-12 09:24:58 -05:00
parent ed16b277f7
commit f68f1f462a
32 changed files with 132 additions and 381 deletions

View File

@@ -7,7 +7,7 @@ import { getUserState } from "~/lib/auth-query";
const checkAdminAccess = query(async () => {
"use server";
const userState = await getUserState();
return { privilegeLevel: userState.privilegeLevel };
return { isAdmin: userState.isAdmin };
}, "test-auth-state");
type EndpointTest = {
@@ -916,7 +916,7 @@ export default function TestPage() {
description="tRPC API testing dashboard for developers to test endpoints and verify functionality."
/>
<Show
when={authState()?.privilegeLevel === "admin"}
when={authState()?.isAdmin}
fallback={
<div class="w-full pt-[30vh] text-center">
<div class="text-text text-2xl">Unauthorized</div>