This commit is contained in:
Owen
2026-06-12 14:44:45 -07:00
parent 5a8a48f9bf
commit 3fd5c98def
3 changed files with 50 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import { priv } from "@app/lib/api";
import { generateBrowserGatewayMetadata } from "@app/lib/browserGatewayMetadata";
import { getBrowserTargetForRequest } from "@app/lib/getBrowserTargetForRequest";
import { loadOrgLoginPageBranding } from "@app/lib/loadOrgLoginPageBranding";
import { AxiosResponse } from "axios";
import axios, { AxiosResponse } from "axios";
import { GetBrowserTargetResponse } from "@server/routers/browserGatewayTarget";
import SshClient from "./SshClient";
import crypto from "crypto";
@@ -152,8 +152,12 @@ export default async function SshPage() {
await waitForRoundTripCompletion(messageIds, cookieHeader);
} catch (err) {
console.error("Error signing SSH key:", err);
const detail = err instanceof Error ? err.message : String(err);
error = `${t("sshErrorSignKeyFailed")}: ${detail}`;
if (axios.isAxiosError(err) && err.response?.status === 403) {
error = t("accessDeniedDescription");
} else {
const detail = err instanceof Error ? err.message : String(err);
error = `${t("sshErrorSignKeyFailed")}: ${detail}`;
}
}
}