From a85a1a97dd1733f82efa0dac2d97da2086b4bc3d Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 28 Mar 2023 16:47:45 +0900 Subject: [PATCH] fix: hotfix identityPool data --- package.json | 2 +- src/core/identity.service.ts | 4 ++-- src/helper/types/lemon-oauth-token.type.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index dac9bf9..356e7b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lemoncloud/lemon-front-lib", - "version": "1.3.7f", + "version": "1.3.7h", "description": "Front Core Library for Lemoncloud", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/core/identity.service.ts b/src/core/identity.service.ts index 027577a..5e97c28 100644 --- a/src/core/identity.service.ts +++ b/src/core/identity.service.ts @@ -218,7 +218,7 @@ export class IdentityService { return 'build credentials!'; } - private async refreshCachedToken(): Promise { + async refreshCachedToken(): Promise { this.logger.log('refreshCachedToken()...'); const originToken: LemonOAuthTokenResult = await this.lemonStorage.getCachedLemonOAuthToken(); const payload: SignaturePayload = { @@ -256,7 +256,7 @@ export class IdentityService { const { credential } = refreshResult; const refreshToken: LemonOAuthTokenResult = { ...refreshResult, - identityPoolId: originToken.identityPoolId, + identityPoolId: originToken.identityPoolId || '', identityToken: originToken.identityToken, }; await this.lemonStorage.saveLemonOAuthToken(refreshToken); diff --git a/src/helper/types/lemon-oauth-token.type.ts b/src/helper/types/lemon-oauth-token.type.ts index e4a1040..c45648a 100644 --- a/src/helper/types/lemon-oauth-token.type.ts +++ b/src/helper/types/lemon-oauth-token.type.ts @@ -3,8 +3,8 @@ export interface LemonOAuthTokenResult { authId: string; credential: LemonCredentials; identityId: string; - identityPoolId: string; identityToken: string; + identityPoolId?: string; error?: any; }