Skip to content

Commit 3e83b7f

Browse files
authored
Merge pull request #35 from lemoncloud-io/develop
fix: handle legacy token format
2 parents b0ea86a + 4eed50c commit 3e83b7f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/core/aws-web.core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ export class AWSWebCore implements WebCoreService {
263263
{ ...body }
264264
);
265265
const refreshToken = {
266-
...response.data,
267266
identityToken: response.data.identityToken || cached.identityToken,
268267
identityPoolId: cached.identityPoolId,
268+
...(response.data.Token ? response.data.Token : response.data),
269269
};
270270
this.logger.info('success to refresh token');
271271
return await this.buildCredentialsByToken(refreshToken);

src/types/lemon.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export interface LemonOAuthToken {
5151
* The access token associated with the token (optional).
5252
*/
5353
accessToken?: string;
54+
/**
55+
* The access token associated with the token (optional).
56+
*/
57+
Token?: LemonOAuthToken;
5458
}
5559

5660
/**

0 commit comments

Comments
 (0)