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

Function saveAuth

packages/cli/src/lib/auth.ts:23–29  ·  view source on GitHub ↗
(data: AuthData)

Source from the content-addressed store, hash-verified

21};
22
23export function saveAuth(data: AuthData) {
24 if (!existsSync(AUTH_DIR)) {
25 // Owner-only permissions (rwx------) so other users on the machine can't read tokens
26 mkdirSync(AUTH_DIR, { mode: 0o700 });
27 }
28 writeFileSync(AUTH_FILE, JSON.stringify(data), { mode: 0o600 });
29}
30
31export function clearAuth() {
32 try {

Callers 1

fetchFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected