Pull in the destination from the api

This commit is contained in:
Owen
2026-05-15 11:48:13 -07:00
parent 868bcd8e34
commit 6010515da0
6 changed files with 29 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import { headers } from "next/headers";
import { internal } from "@app/lib/api";
import { priv } from "@app/lib/api";
import { AxiosResponse } from "axios";
import { GetBrowserTargetResponse } from "@server/routers/resource";
import SshClient from "./SshClient";
@@ -19,11 +19,12 @@ export default async function SshPage() {
let error: string | null = null;
try {
const res = await internal.get<AxiosResponse<GetBrowserTargetResponse>>(
const res = await priv.get<AxiosResponse<GetBrowserTargetResponse>>(
`/resource/browser-target?fullDomain=${encodeURIComponent(hostname)}`
);
target = res.data.data;
} catch {
} catch (error) {
console.error("Error fetching browser target:", error);
error = "No resource found for this domain";
}