fix(smoke): read CLI credentials from ~/.mcpctl (active path)
Some checks failed
CI/CD / lint (pull_request) Successful in 1m15s
CI/CD / test (pull_request) Successful in 1m17s
CI/CD / typecheck (pull_request) Successful in 2m52s
CI/CD / smoke (pull_request) Failing after 1m54s
CI/CD / build (pull_request) Successful in 4m49s
CI/CD / publish (pull_request) Has been skipped
Some checks failed
CI/CD / lint (pull_request) Successful in 1m15s
CI/CD / test (pull_request) Successful in 1m17s
CI/CD / typecheck (pull_request) Successful in 2m52s
CI/CD / smoke (pull_request) Failing after 1m54s
CI/CD / build (pull_request) Successful in 4m49s
CI/CD / publish (pull_request) Has been skipped
passwd smoke read ~/.config/mcpctl/credentials and silently skipped; the CLI stores creds at ~/.mcpctl/credentials. Now verified live against prod (4/4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,10 +62,14 @@ async function healthz(): Promise<boolean> {
|
||||
}
|
||||
|
||||
function adminToken(): string | undefined {
|
||||
try {
|
||||
const raw = readFileSync(join(homedir(), '.config', 'mcpctl', 'credentials'), 'utf-8');
|
||||
return (JSON.parse(raw) as { token?: string }).token;
|
||||
} catch { return undefined; }
|
||||
// The CLI stores credentials at ~/.mcpctl/credentials (see config/loader.ts).
|
||||
for (const p of [join(homedir(), '.mcpctl', 'credentials'), join(homedir(), '.config', 'mcpctl', 'credentials')]) {
|
||||
try {
|
||||
const tok = (JSON.parse(readFileSync(p, 'utf-8')) as { token?: string }).token;
|
||||
if (tok) return tok;
|
||||
} catch { /* try next */ }
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async function login(email: string, password: string): Promise<Resp> {
|
||||
|
||||
Reference in New Issue
Block a user