MCPcopy Create free account
hub / github.com/firebase/firebase-tools / getProjectDefaultAccount

Function getProjectDefaultAccount

src/auth.ts:68–82  ·  view source on GitHub ↗
(projectDir?: string | null)

Source from the content-addressed store, hash-verified

66 * @param projectDir the Firebase project directory.
67 */
68export function getProjectDefaultAccount(projectDir?: string | null): Account | undefined {
69 if (!projectDir) {
70 return getGlobalDefaultAccount();
71 }
72
73 const activeAccounts = configstore.get("activeAccounts") || {};
74 const email: string | undefined = activeAccounts[projectDir];
75
76 if (!email) {
77 return getGlobalDefaultAccount();
78 }
79
80 const allAccounts = getAllAccounts();
81 return allAccounts.find((a) => a.user.email === email);
82}
83
84/**
85 * Get all authenticated accounts _besides_ the default account.

Callers 8

auth.spec.tsFile · 0.90
generateSDKFunction · 0.90
startMethod · 0.90
prepareFrameworksFunction · 0.90
buildFunction · 0.90
startAllFunction · 0.90
selectAccountFunction · 0.85

Calls 3

getGlobalDefaultAccountFunction · 0.85
getAllAccountsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…