diff --git a/avRegistration/auth-method-service.js b/avRegistration/auth-method-service.js index b7ea3438..d3cd6bf0 100644 --- a/avRegistration/auth-method-service.js +++ b/avRegistration/auth-method-service.js @@ -126,6 +126,7 @@ angular.module('avRegistration') var decodedToken = authmethod.decodeToken($http.defaults.headers.common.Authorization); var secsDiff = getSecondsDifference(authmethod.lastAuthDate, now); var halfLife = decodedToken.expiry_secs_diff * 0.5; + console.log("secsDiff " + secsDiff + " halfLife " + halfLife); if (secsDiff <= halfLife) { return; } diff --git a/dist/appCommon-v10.4.2.js b/dist/appCommon-v10.4.2.js index 6b189a72..1d2ca85a 100644 --- a/dist/appCommon-v10.4.2.js +++ b/dist/appCommon-v10.4.2.js @@ -30,8 +30,9 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist if (authmethod.admin = isAdmin, $http.defaults.headers.common.Authorization = auth, authmethod.lastAuthDate = new Date(), !authmethod.iddleDetectionSetup) return authmethod.iddleDetectionSetup = !0, callback = function() { - var date1, date2, now = new Date(), decodedToken = authmethod.decodeToken($http.defaults.headers.common.Authorization); - (date1 = authmethod.lastAuthDate, date2 = now, Math.abs(date2 - date1) / 1e3) <= .5 * decodedToken.expiry_secs_diff || (authmethod.lastAuthDate = now, + var date2, now = new Date(), halfLife = authmethod.decodeToken($http.defaults.headers.common.Authorization), secsDiff = (secsDiff = authmethod.lastAuthDate, + date2 = now, Math.abs(date2 - secsDiff) / 1e3), halfLife = .5 * halfLife.expiry_secs_diff; + console.log("secsDiff " + secsDiff + " halfLife " + halfLife), secsDiff <= halfLife || (authmethod.lastAuthDate = now, authmethod.refreshAuthToken(autheventid)); }, [ "click", "keypress", "mousemove", "mousedown", "touchstart", "touchmove" ].forEach(function(event) { document.addEventListener(event, callback);