fix: prefix api endpoint with account subdomain

This commit is contained in:
Derrick Hammer 2024-03-13 12:57:21 -04:00
parent cde0ea645f
commit 3e8aaa1dba
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 1 deletions

View File

@ -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 {