From bed27ef9a2e63996adffb63d75f3d289e15fadf0 Mon Sep 17 00:00:00 2001 From: Nicholas Orlowsky Date: Fri, 17 Nov 2023 17:03:20 -0500 Subject: [PATCH] fix ssl button --- src/components/DashboardPage.tsx | 2 +- src/nws-api/calls.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DashboardPage.tsx b/src/components/DashboardPage.tsx index 01bf89a..ced4050 100644 --- a/src/components/DashboardPage.tsx +++ b/src/components/DashboardPage.tsx @@ -54,7 +54,7 @@ export default function DashboardPage() { if (rawSession != null) { let session: SessionKey = JSON.parse(rawSession); - await enableSSL(account!.id!, e.serviceId, session); + await enableSSL(account!.id!, e.serviceId, host.hostname, session); } }}>Enable SSL :

SSL is enabled!

} diff --git a/src/nws-api/calls.ts b/src/nws-api/calls.ts index 9efae6b..aacf0d4 100644 --- a/src/nws-api/calls.ts +++ b/src/nws-api/calls.ts @@ -50,8 +50,8 @@ export async function getNamespaces(accountId: string, skey: SessionKey): Promis return namespaces; } -export async function enableSSL(accountId: string, serviceId: string, session: SessionKey) { - await fetch('https://api-nws.nickorlow.com/service/'+accountId+'/service/'+serviceId+"/ssl", { +export async function enableSSL(accountId: string, serviceId: string, hostname: string, session: SessionKey) { + await fetch('https://api-nws.nickorlow.com/'+accountId+'/service/'+serviceId+"/hosts/"+hostname+"/ssl", { headers: { Authorization: btoa(session.accountId + ":" + session.id) },