MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / checkSessionIsAdmin

Function checkSessionIsAdmin

packages/internal/src/utils/auth.ts:45–54  ·  view source on GitHub ↗
(
  session: { user?: { id?: string } } | null,
)

Source from the content-addressed store, hash-verified

43 * This is a generic version that can be used with any session object
44 */
45export async function checkSessionIsAdmin(
46 session: { user?: { id?: string } } | null,
47): Promise<AdminUser | null> {
48 if (!session?.user?.id) {
49 return null
50 }
51
52 const result = await checkUserIsCodebuffAdmin(session.user.id)
53 return result
54}
55
56/**
57 * Check if a user ID corresponds to a Codebuff admin

Callers

nothing calls this directly

Calls 1

checkUserIsCodebuffAdminFunction · 0.85

Tested by

no test coverage detected