1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Added lock timer and adjusted context menus and badge appropriately

This commit is contained in:
Kyle Spearrin
2016-10-25 00:23:21 -04:00
parent 80ed37ada6
commit c982667338
8 changed files with 122 additions and 62 deletions

View File

@@ -172,11 +172,17 @@
params: { animation: null }
});
})
.run(function ($rootScope, userService, loginService, cryptoService, tokenService, $state) {
.run(function ($rootScope, userService, loginService, cryptoService, tokenService, $state, constantsService) {
$rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
cryptoService.getKey(false, function (key) {
tokenService.getToken(function (token) {
userService.isAuthenticated(function (isAuthenticated) {
if (isAuthenticated) {
var obj = {};
obj[constantsService.lastActiveKey] = (new Date()).getTime();
chrome.storage.local.set(obj, function () { });
}
if (!toState.data || !toState.data.authorize) {
if (isAuthenticated && !tokenService.isTokenExpired(token)) {
event.preventDefault();