fix(config): combine stderr+stdout when detecting auth errors in verify

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gina888666
2026-06-30 21:12:27 +08:00
parent ac1ea2e336
commit e3b713b150
+4 -5
View File
@@ -93,11 +93,10 @@ function verify(): "ok" | "auth_fail" | "network_fail" {
execSync("gmgn-cli track follow-wallet --chain sol --limit 1", { stdio: "pipe" });
return "ok";
} catch (e: unknown) {
const output = (() => {
if (e && typeof e === "object" && "stderr" in e) return String((e as { stderr: unknown }).stderr);
if (e && typeof e === "object" && "stdout" in e) return String((e as { stdout: unknown }).stdout);
return String(e);
})();
const output = [
(e as any).stderr?.toString() ?? "",
(e as any).stdout?.toString() ?? "",
].join(" ");
if (/401|403|unauthorized|forbidden|invalid.*key|key.*invalid|signature/i.test(output)) {
return "auth_fail";
}