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

Function initUser

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

Source from the content-addressed store, hash-verified

51 * This pre-fetches the email so getUser() can remain synchronous.
52 */
53export async function initUser(): Promise<void> {
54 if (cachedEmail === null && !emailFetchPromise) {
55 emailFetchPromise = getEmailAsync()
56 cachedEmail = await emailFetchPromise
57 emailFetchPromise = null
58 // Clear memoization cache so next call picks up the email
59 getCoreUserData.cache.clear?.()
60 }
61}
62
63/**
64 * Reset all user data caches. Call on auth changes (login/logout/account switch)

Callers 1

startDeferredPrefetchesFunction · 0.85

Calls 2

getEmailAsyncFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected