session state simplification

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

View File

@@ -12,7 +12,7 @@ const getPostForEdit = query(async (id: string) => {
const { ConnectionFactory } = await import("~/server/utils");
const userState = await getUserState();
if (userState.privilegeLevel !== "admin") {
if (!userState.isAdmin) {
throw redirect("/401");
}
@@ -35,7 +35,7 @@ const getPostForEdit = query(async (id: string) => {
return {
post,
tags,
privilegeLevel: userState.privilegeLevel,
isAdmin: userState.isAdmin,
userID: userState.userId
};
}, "post-for-edit");