1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

Added two factor flow into identity login

This commit is contained in:
Kyle Spearrin
2017-01-18 22:14:51 -05:00
parent 6bb6c7074b
commit 0b63eb58ba
8 changed files with 88 additions and 154 deletions

View File

@@ -12,9 +12,11 @@ var FolderRequest = function (folder) {
this.name = folder.name ? folder.name.encryptedString : null;
};
var TokenRequest = function (email, masterPasswordHash, device) {
var TokenRequest = function (email, masterPasswordHash, code, device) {
this.email = email;
this.masterPasswordHash = masterPasswordHash;
this.code = code;
this.provider = 'Authenticator';
this.device = null;
if (device) {
this.device = new DeviceRequest(device);
@@ -36,6 +38,11 @@ var TokenRequest = function (email, masterPasswordHash, device) {
obj.devicePushToken = this.device.pushToken;
}
if (this.code && this.provider) {
obj.twoFactorCode = this.code;
obj.twoFactorProvider = this.provider;
}
return obj;
};
};
@@ -51,12 +58,6 @@ var PasswordHintRequest = function (email) {
this.email = email;
};
var TokenTwoFactorRequest = function (code) {
this.code = code;
this.provider = "Authenticator";
this.device = null;
};
var DeviceTokenRequest = function () {
this.pushToken = null;
};