1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

check response in all cases

This commit is contained in:
Kyle Spearrin 2018-08-03 11:27:42 -04:00
parent d41c4d16d4
commit e0ff13e193

View File

@ -124,14 +124,15 @@ export class LoginCommand {
} }
} }
const twoFactorResponse = await this.authService.logInTwoFactor(selectedProvider.type, response = await this.authService.logInTwoFactor(selectedProvider.type,
twoFactorToken, false); twoFactorToken, false);
if (twoFactorResponse.twoFactor) {
return Response.error('Login failed.');
}
} }
} }
if (response.twoFactor) {
return Response.error('Login failed.');
}
await this.syncService.fullSync(true); await this.syncService.fullSync(true);
const res = new MessageResponse('You are logged in!', '\n' + const res = new MessageResponse('You are logged in!', '\n' +
'To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:\n' + 'To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:\n' +