MCPcopy
hub / github.com/upstash/context7 / announceIdentity

Function announceIdentity

packages/cli/src/commands/auth.ts:97–109  ·  view source on GitHub ↗
(accessToken: string)

Source from the content-addressed store, hash-verified

95}
96
97async function announceIdentity(accessToken: string): Promise<string> {
98 try {
99 const whoami = await fetchWhoami(accessToken);
100 const name = whoami.email || whoami.name;
101 if (!name) return "Login successful!";
102 const team = whoami.teamspace?.name;
103 return team
104 ? `Logged in as ${pc.bold(name)} ${pc.dim(`(${team})`)}`
105 : `Logged in as ${pc.bold(name)}`;
106 } catch {
107 return "Login successful!";
108 }
109}
110
111export async function performLogin(openBrowser = true): Promise<string | null> {
112 const spinner = ora("Preparing login...").start();

Callers 1

performLoginFunction · 0.85

Calls 1

fetchWhoamiFunction · 0.85

Tested by

no test coverage detected