MCPcopy
hub / github.com/codeaashu/claude-code / getEmail

Function getEmail

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

Source from the content-addressed store, hash-verified

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