mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
setup various pages and services
This commit is contained in:
23
src/popup/app/accounts/accountsLoginController.js
Normal file
23
src/popup/app/accounts/accountsLoginController.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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');
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user