MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getAuthConfig

Function getAuthConfig

apps/web/src/scripts/managed-indexing/test.ts:57–81  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

55
56// Authentication
57async function getAuthConfig(organizationId: string): Promise<AuthConfig> {
58 console.log('🔑 Generating authentication token...');
59 if (z.uuid().safeParse(organizationId).success) {
60 console.log(` Organization ID: ${organizationId}`);
61 const authToken = await getAuthToken(organizationId);
62 const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
63 console.log(' ✅ Token generated successfully');
64 return { authToken, baseUrl, organizationId };
65 } else {
66 const user = await db
67 .select()
68 .from(kilocode_users)
69 .where(eq(kilocode_users.google_user_email, organizationId))
70 .limit(1);
71 if (!user || user.length === 0) {
72 throw new Error(`User with email ${organizationId} not found`);
73 }
74
75 console.log(` User Email: ${organizationId}`);
76 const authToken = generateApiToken(user[0]);
77 const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
78 console.log(' ✅ Token generated successfully');
79 return { authToken, baseUrl, organizationId: null };
80 }
81}
82
83// File operations
84function findTypeScriptFiles(dir: string): string[] {

Callers 1

runFunction · 0.70

Calls 4

getAuthTokenFunction · 0.90
generateApiTokenFunction · 0.90
logMethod · 0.65
limitMethod · 0.65

Tested by

no test coverage detected