From 3e8aaa1dbaba47535c7504ecf166ba8dac5624fa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 13 Mar 2024 12:57:21 -0400 Subject: [PATCH] fix: prefix api endpoint with account subdomain --- src/account.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/account.ts b/src/account.ts index cf93b6b..5bbc00f 100644 --- a/src/account.ts +++ b/src/account.ts @@ -28,7 +28,10 @@ export default class AccountApi { private jwtToken?: string; constructor(apiUrl: string) { - this.apiUrl = apiUrl; + let apiUrlParsed = new URL(apiUrl); + + apiUrlParsed.hostname = `account.${apiUrlParsed.hostname}`; + this.apiUrl = apiUrlParsed.toString(); } public static create(apiUrl: string): AccountApi {