(
session: { user?: { id?: string } } | null,
)
| 43 | * This is a generic version that can be used with any session object |
| 44 | */ |
| 45 | export 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 |
nothing calls this directly
no test coverage detected