1
0
mirror of https://github.com/bitwarden/jslib synced 2026-01-05 01:53:13 +00:00

Move api KC logic into entry method

This commit is contained in:
Thomas Rittson
2021-12-20 11:31:09 +10:00
parent cfb2ac133a
commit 28e98905a0

View File

@@ -197,6 +197,12 @@ export class AuthService implements AuthServiceAbstraction {
return result;
}
const tokenResponse = response as IdentityTokenResponse;
if (tokenResponse.apiUseKeyConnector) {
const keyConnectorUrl = this.environmentService.getKeyConnectorUrl();
await this.keyConnectorService.getAndSetKey(keyConnectorUrl);
}
await this.completeLogIn();
return result;
}
@@ -286,11 +292,6 @@ export class AuthService implements AuthServiceAbstraction {
if (this.setCryptoKeys) {
if (!this.isNewSsoUser(code, tokenResponse.key)) {
if (tokenResponse.apiUseKeyConnector) {
const keyConnectorUrl = this.environmentService.getKeyConnectorUrl();
await this.keyConnectorService.getAndSetKey(keyConnectorUrl);
}
await this.cryptoService.setEncKey(tokenResponse.key);
// User doesn't have a key pair yet (old account), let's generate one for them