Add option to specify host in Auth config

This commit is contained in:
RaviAnand Mohabir 2022-01-12 19:53:53 +01:00
parent a748c345cb
commit aea2f9d16e

View File

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