From aea2f9d16e80455131f1a242ffa0fe035fb052b3 Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Wed, 12 Jan 2022 19:53:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20option=20to=20specify=20`host?= =?UTF-8?q?`=20in=20Auth=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auth.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index fe1fd58..6336f93 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -14,6 +14,7 @@ interface AuthConfig { jwtSecret?: string; jwtExpiresIn?: string | number; host?: string; + protocol?: string; basePath?: string; } @@ -70,7 +71,9 @@ export class Auth { } getBaseUrl(host?: string) { - return this.config?.host ?? `http://${host}`; + const protocol = this.config?.protocol ?? "http"; + host = this.config?.host ?? host; + return `${protocol}://${host}`; } getPath(path: string) {