From 3bc2dfadce4c2a4fdb3795dedf4dd5b29be623ed Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 13 Mar 2024 18:26:52 -0400 Subject: [PATCH] Revert "fix: use URL.URL" This reverts commit d18e3a9da50d42fe82b2bfa05e147f877dab2466. --- src/account.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/account.ts b/src/account.ts index d06999a..4dd5ccc 100644 --- a/src/account.ts +++ b/src/account.ts @@ -24,7 +24,6 @@ import { postApiAuthPasswordResetConfirm, } from "./account/generated/index.js"; import { AxiosResponse } from "axios"; -import * as URL from 'url'; export class AccountApi { private apiUrl: string; @@ -32,7 +31,7 @@ export class AccountApi { constructor(apiUrl: string) { - let apiUrlParsed = new URL.URL(apiUrl); + let apiUrlParsed = new URL(apiUrl); apiUrlParsed.hostname = `account.${apiUrlParsed.hostname}`; this.apiUrl = apiUrlParsed.toString(); @@ -56,7 +55,7 @@ export class AccountApi { ret = this.checkSuccessVal(ret); if (ret) { - this._jwtToken = (ret as LoginResponse).token; + this.jwtToken = (ret as LoginResponse).token; return true; } @@ -64,7 +63,7 @@ export class AccountApi { } public async logout(): Promise { - this._jwtToken = undefined; + this.jwtToken = undefined; return true; } @@ -198,8 +197,8 @@ export class AccountApi { private buildOptions(): any { const headers: any = {}; - if (this._jwtToken) { - headers.Authorization = `Bearer ${this._jwtToken}`; + if (this.jwtToken) { + headers.Authorization = `Bearer ${this.jwtToken}`; } return {