MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / loadToken

Function loadToken

apps/cli/src/lib/storage/credentials.ts:30–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30export async function loadToken(): Promise<string | null> {
31 try {
32 const data = await fs.readFile(CREDENTIALS_FILE, "utf-8")
33 const credentials: Credentials = JSON.parse(data)
34 return credentials.token
35 } catch (error) {
36 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
37 return null
38 }
39 throw error
40 }
41}
42
43export async function loadCredentials(): Promise<Credentials | null> {
44 try {

Callers 3

statusFunction · 0.85
hasTokenFunction · 0.85

Calls 2

parseMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected