MCPcopy Create free account
hub / github.com/Noumena-Network/code / getEmail

Function getEmail

src/utils/user.ts:141–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139}
140
141function getEmail(): string | undefined {
142 // Return cached email if available (from async initialization)
143 if (cachedEmail !== null) {
144 return cachedEmail
145 }
146
147 // Only include OAuth email when actively using OAuth authentication
148 const analyticsSession = getCurrentAnalyticsSession()
149 if (analyticsSession?.identity.email) {
150 return analyticsSession.identity.email
151 }
152
153 // Ant-only fallbacks below (no execSync)
154 if ((process.env.NCODE_BUILD_MODE !== 'noumena' && process.env.USER_TYPE !== 'ant')) {
155 return undefined
156 }
157
158 if (process.env.COO_CREATOR) {
159 return `${process.env.COO_CREATOR}@anthropic.com`
160 }
161
162 // If initUser() wasn't called, we return undefined instead of blocking
163 return undefined
164}
165
166async function getEmailAsync(): Promise<string | undefined> {
167 // Only include OAuth email when actively using OAuth authentication

Callers 1

user.tsFile · 0.85

Calls 1

Tested by

no test coverage detected