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:
@@ -23,5 +23,5 @@ export abstract class TokenService {
|
||||
getName: () => Promise<string>;
|
||||
getPremium: () => Promise<boolean>;
|
||||
getIssuer: () => Promise<string>;
|
||||
getIsExternal: () => boolean;
|
||||
getIsExternal: () => Promise<boolean>;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user