MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / getAuth

Function getAuth

packages/cli/src/lib/auth.ts:13–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13export function getAuth(): AuthData | null {
14 try {
15 const data = readFileSync(AUTH_FILE, "utf-8");
16 const parsed = JSON.parse(data) as Partial<AuthData>;
17 return typeof parsed.token === "string" ? { token: parsed.token } : null;
18 } catch {
19 return null;
20 }
21};
22
23export function saveAuth(data: AuthData) {
24 if (!existsSync(AUTH_DIR)) {

Callers 2

api-client.tsFile · 0.90
headersFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected