1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +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

@@ -2,12 +2,15 @@
.module('bit.accounts')
.controller('accountsLoginTwoFactorController', function ($scope, $state, authService, toastr, utilsService,
$analytics, i18nService) {
$analytics, i18nService, $stateParams) {
$scope.i18n = i18nService;
$scope.model = {};
utilsService.initListSectionItemListeners($(document), angular);
$('#code').focus();
var email = $stateParams.email;
var masterPassword = $stateParams.masterPassword;
$scope.loginPromise = null;
$scope.login = function (model) {
if (!model.code) {
@@ -15,7 +18,7 @@
return;
}
$scope.loginPromise = authService.logInTwoFactor(model.code);
$scope.loginPromise = authService.logIn(email, masterPassword, model.code);
$scope.loginPromise.then(function () {
$analytics.eventTrack('Logged In From Two-step');
$state.go('tabs.vault', { animation: 'in-slide-left', syncOnLoad: true });