mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2024-11-20 19:07:20 +01:00
✨ Add option to specify host
in Auth config
This commit is contained in:
parent
a748c345cb
commit
aea2f9d16e
@ -14,6 +14,7 @@ interface AuthConfig {
|
|||||||
jwtSecret?: string;
|
jwtSecret?: string;
|
||||||
jwtExpiresIn?: string | number;
|
jwtExpiresIn?: string | number;
|
||||||
host?: string;
|
host?: string;
|
||||||
|
protocol?: string;
|
||||||
basePath?: string;
|
basePath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +71,9 @@ export class Auth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBaseUrl(host?: string) {
|
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) {
|
getPath(path: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user