1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

rename "vault" to "web"

This commit is contained in:
Kyle Spearrin
2016-08-08 19:09:19 -04:00
parent 69be7be0e5
commit 0996ef86b7
90 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,48 @@
angular
.module('bit.accounts')
.controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService, $state, appSettings) {
var rememberedEmail = $cookies.get(appSettings.rememberdEmailCookieName);
if (rememberedEmail) {
$scope.model = {
email: rememberedEmail,
rememberEmail: true
};
}
$scope.login = function (model) {
$scope.loginPromise = authService.logIn(model.email, model.masterPassword);
$scope.loginPromise.then(function () {
if (model.rememberEmail) {
var cookieExpiration = new Date();
cookieExpiration.setFullYear(cookieExpiration.getFullYear() + 10);
$cookies.put(
appSettings.rememberdEmailCookieName,
model.email,
{ expires: cookieExpiration });
}
else {
$cookies.remove(appSettings.rememberdEmailCookieName);
}
var profile = authService.getUserProfile();
if (profile.twoFactor) {
$state.go('frontend.login.twoFactor');
}
else {
$state.go('backend.vault');
}
});
};
$scope.twoFactor = function (model) {
// Only supporting Authenticator provider for now
$scope.twoFactorPromise = authService.logInTwoFactor(model.code, "Authenticator");
$scope.twoFactorPromise.then(function () {
$state.go('backend.vault');
});
};
});