- Timestamp:
- 01/29/26 03:53:28 (5 months ago)
- Branches:
- main
- Children:
- b348db4
- Parents:
- adc31ef
- File:
-
- 1 edited
-
server/telefunc/ctx.ts (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/telefunc/ctx.ts
radc31ef rbe22289 10 10 const n = Number(sessionUserId); 11 11 return Number.isInteger(n) && n > 0 ? n : undefined; 12 }13 14 export function requireUser() {15 const c = ctx();16 const userId = parseSessionUserId(c.session?.user?.id);17 if (!userId) throw Abort();18 return { c, userId };19 12 } 20 13 … … 31 24 } 32 25 26 export function requireUser() { 27 const c = ctx(); 28 const userId = parseSessionUserId(c.session?.user?.id); 29 if (!userId) throw Abort(); 30 return { c, userId }; 31 } 32 33 33 export async function requireAdmin() { 34 34 const { c, userId } = requireUser(); 35 36 35 37 36 if(!c.session?.user?.isAdmin) throw Abort();
Note:
See TracChangeset
for help on using the changeset viewer.
