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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user