MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getEmail

Function getEmail

source code/utils/user.ts:139–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

user.tsFile · 0.85

Calls 1

getOauthAccountInfoFunction · 0.70

Tested by

no test coverage detected