Hub client: accept the public key pasted on one line; clearer error for a bad key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mt6TCv85T9VKRq3cV7rXq
This commit is contained in:
2026-10-26 12:58:44 +02:00
co-authored by Claude Opus 5.5
parent b67f40c2df
commit ff98a6fdfd
3 changed files with 45 additions and 5 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ function publicKey() {
const pem = hubPublicKey();
if (!pem) return null;
if (pem !== publicKeyPem) {
publicKeyObject = crypto.createPublicKey(pem);
try {
publicKeyObject = crypto.createPublicKey(pem);
} catch {
throw new Error("The Hub public key can't be read — check HUB_PUBLIC_KEY in backend/.env (copy it from the Hub's Settings page).");
}
publicKeyPem = pem;
}
return publicKeyObject;