1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

dont set keys if not there on sso (#152)

* dont set keys if not there on sso

* a comment
This commit is contained in:
Kyle Spearrin
2020-08-17 14:27:44 -04:00
committed by GitHub
parent 8fe78916e2
commit 9957125d3a

View File

@@ -308,6 +308,9 @@ export class AuthService implements AuthServiceAbstraction {
if (hashedPassword != null) { if (hashedPassword != null) {
await this.cryptoService.setKeyHash(hashedPassword); await this.cryptoService.setKeyHash(hashedPassword);
} }
// Skip this step during SSO new user flow. No key is returned from server.
if (code == null || tokenResponse.key != null) {
await this.cryptoService.setEncKey(tokenResponse.key); await this.cryptoService.setEncKey(tokenResponse.key);
// User doesn't have a key pair yet (old account), let's generate one for them // User doesn't have a key pair yet (old account), let's generate one for them
@@ -324,6 +327,7 @@ export class AuthService implements AuthServiceAbstraction {
await this.cryptoService.setEncPrivateKey(tokenResponse.privateKey); await this.cryptoService.setEncPrivateKey(tokenResponse.privateKey);
} }
}
if (this.vaultTimeoutService != null) { if (this.vaultTimeoutService != null) {
this.vaultTimeoutService.biometricLocked = false; this.vaultTimeoutService.biometricLocked = false;