1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-26 05:03:41 +00:00

[chore] Resolve TokenService merge issues from KeyConnector

This commit is contained in:
addison
2021-11-09 15:07:14 -05:00
parent ab2b9881fe
commit 935aa08efa
2 changed files with 3 additions and 15 deletions

View File

@@ -23,5 +23,5 @@ export abstract class TokenService {
getName: () => Promise<string>;
getPremium: () => Promise<boolean>;
getIssuer: () => Promise<string>;
getIsExternal: () => boolean;
getIsExternal: () => Promise<boolean>;
}

View File

@@ -209,10 +209,8 @@ export class TokenService implements TokenServiceAbstraction {
return decoded.iss as string;
}
<<<<<<< HEAD
=======
getIsExternal(): boolean {
const decoded = this.decodeToken();
async getIsExternal(): Promise<boolean> {
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<boolean> {
const timeout = await this.stateService.getVaultTimeout();
const action = await this.stateService.getVaultTimeoutAction();