MCPcopy
hub / github.com/simstudioai/sim / getAdminUser

Function getAdminUser

packages/db/scripts/register-sso-provider.ts:384–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

382}
383
384async function getAdminUser(): Promise<{ id: string; email: string } | null> {
385 const adminEmail = process.env.SSO_USER_EMAIL
386 if (!adminEmail) {
387 logger.error('SSO_USER_EMAIL is required to identify the admin user')
388 return null
389 }
390
391 try {
392 const users = await db.select().from(user).where(eq(user.email, adminEmail))
393 if (users.length === 0) {
394 logger.error(`No user found with email: ${adminEmail}`)
395 logger.error('Please ensure this user exists in your database first')
396 return null
397 }
398 return { id: users[0].id, email: users[0].email }
399 } catch (error) {
400 logger.error('Failed to query user:', error)
401 return null
402 }
403}
404
405async function registerSSOProvider(): Promise<boolean> {
406 try {

Callers 1

registerSSOProviderFunction · 0.85

Calls 2

errorMethod · 0.80
eqFunction · 0.50

Tested by

no test coverage detected