diff --git a/src/service/Credential.service.ts b/src/service/Credential.service.ts index 3d8e1dc..da5de98 100644 --- a/src/service/Credential.service.ts +++ b/src/service/Credential.service.ts @@ -257,9 +257,12 @@ export class CredentialService { return await Fetch.post("/login", { accessKey, secretKey }, this.configuration) } - public async renewToken(refreshToken: string): Promise { - const configuration: Configuration = { accesToken: refreshToken, base: null } - return await Fetch.post("/renewToken", { refreshToken }, configuration) + const AUTH_SESSION = JSON.parse(sessionStorage?.getItem("LAMP._auth") ?? "null") + const baseAPIPath = AUTH_SESSION?.serverAddress + if(baseAPIPath){ + const configuration: Configuration = { accesToken: refreshToken, base: `https://${baseAPIPath}` } + return await Fetch.post("/renewToken", { refreshToken }, configuration) + } } } diff --git a/src/service/Fetch.ts b/src/service/Fetch.ts index 7272ea5..1037d89 100644 --- a/src/service/Fetch.ts +++ b/src/service/Fetch.ts @@ -73,6 +73,7 @@ async function _fetch( } if (authorization) { + console.log(`####configuration.base`, configuration.base) try { var result = await ( await fetch(`${configuration.base}${route}`, {