From e0ff13e193778fcf1be986a63cbe2eaba06f6284 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 3 Aug 2018 11:27:42 -0400 Subject: [PATCH] check response in all cases --- src/commands/login.command.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/login.command.ts b/src/commands/login.command.ts index c06ed69..08667e1 100644 --- a/src/commands/login.command.ts +++ b/src/commands/login.command.ts @@ -124,14 +124,15 @@ export class LoginCommand { } } - const twoFactorResponse = await this.authService.logInTwoFactor(selectedProvider.type, + response = await this.authService.logInTwoFactor(selectedProvider.type, twoFactorToken, false); - if (twoFactorResponse.twoFactor) { - return Response.error('Login failed.'); - } } } + if (response.twoFactor) { + return Response.error('Login failed.'); + } + await this.syncService.fullSync(true); 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' +