bitwarden-estensione-browser/src/popup/app/accounts/accountsLoginController.js

24 lines
758 B
JavaScript

angular
.module('bit.accounts')
.controller('accountsLoginController', function ($scope, $state, loginService, userService) {
$scope.login = function (model) {
$scope.loginPromise = loginService.logIn(model.email, model.masterPassword);
$scope.loginPromise.then(function () {
userService.getUserProfile(function (profile) {
if (profile.twoFactor) {
$state.go('login.twoFactor');
}
else {
$state.go('tabs.current');
}
});
});
};
$scope.twoFactor = function (model) {
$state.go('tabs.current');
};
});