From 935aa08efad587701efcf66a85ceed94be9c2d2a Mon Sep 17 00:00:00 2001 From: addison Date: Tue, 9 Nov 2021 15:07:14 -0500 Subject: [PATCH] [chore] Resolve TokenService merge issues from KeyConnector --- common/src/abstractions/token.service.ts | 2 +- common/src/services/token.service.ts | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/common/src/abstractions/token.service.ts b/common/src/abstractions/token.service.ts index 22c77f6e..e4e2eb02 100644 --- a/common/src/abstractions/token.service.ts +++ b/common/src/abstractions/token.service.ts @@ -23,5 +23,5 @@ export abstract class TokenService { getName: () => Promise; getPremium: () => Promise; getIssuer: () => Promise; - getIsExternal: () => boolean; + getIsExternal: () => Promise; } diff --git a/common/src/services/token.service.ts b/common/src/services/token.service.ts index e1388af9..f2bead7c 100644 --- a/common/src/services/token.service.ts +++ b/common/src/services/token.service.ts @@ -209,10 +209,8 @@ export class TokenService implements TokenServiceAbstraction { return decoded.iss as string; } -<<<<<<< HEAD -======= - getIsExternal(): boolean { - const decoded = this.decodeToken(); + async getIsExternal(): Promise { + const decoded = await this.decodeToken(); if (!Array.isArray(decoded.amr)) { throw new Error('No amr found'); } @@ -220,16 +218,6 @@ export class TokenService implements TokenServiceAbstraction { return decoded.amr.includes('external'); } - private async storeTokenValue(key: string, value: string) { - if (await this.skipTokenStorage()) { - // if we have a vault timeout and the action is log out, don't store token - return; - } - - return this.storageService.save(key, value); - } - ->>>>>>> master private async skipTokenStorage(): Promise { const timeout = await this.stateService.getVaultTimeout(); const action = await this.stateService.getVaultTimeoutAction();