From 4057c478c67ea3b1e57cdfe4eef033aed6118158 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 24 Jan 2017 22:20:52 -0500 Subject: [PATCH] react to two factor changes in auth apis --- src/models/api/requestModels.js | 8 ++++---- src/popup/app/services/authService.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/api/requestModels.js b/src/models/api/requestModels.js index 32169105cb..a12a283378 100644 --- a/src/models/api/requestModels.js +++ b/src/models/api/requestModels.js @@ -12,10 +12,10 @@ var FolderRequest = function (folder) { this.name = folder.name ? folder.name.encryptedString : null; }; -var TokenRequest = function (email, masterPasswordHash, code, device) { +var TokenRequest = function (email, masterPasswordHash, token, device) { this.email = email; this.masterPasswordHash = masterPasswordHash; - this.code = code; + this.token = token; this.provider = 'Authenticator'; this.device = null; if (device) { @@ -38,8 +38,8 @@ var TokenRequest = function (email, masterPasswordHash, code, device) { obj.devicePushToken = this.device.pushToken; } - if (this.code && this.provider) { - obj.twoFactorCode = this.code; + if (this.token && this.provider) { + obj.twoFactorToken = this.token; obj.twoFactorProvider = this.provider; } diff --git a/src/popup/app/services/authService.js b/src/popup/app/services/authService.js index d9bc727f9c..db48620baf 100644 --- a/src/popup/app/services/authService.js +++ b/src/popup/app/services/authService.js @@ -5,12 +5,12 @@ folderService, settingsService, syncService) { var _service = {}; - _service.logIn = function (email, masterPassword, twoFactorCode) { + _service.logIn = function (email, masterPassword, twoFactorToken) { email = email.toLowerCase(); var key = cryptoService.makeKey(masterPassword, email); var deferred = $q.defer(); cryptoService.hashPassword(masterPassword, key, function (hashedPassword) { - var request = new TokenRequest(email, hashedPassword, twoFactorCode); + var request = new TokenRequest(email, hashedPassword, twoFactorToken); apiService.postIdentityToken(request, function (response) { // success