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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user