diff --git a/packages/node_modules/@node-red/editor-api/lib/auth/tokens.js b/packages/node_modules/@node-red/editor-api/lib/auth/tokens.js index 31c12d228..6e867d7df 100644 --- a/packages/node_modules/@node-red/editor-api/lib/auth/tokens.js +++ b/packages/node_modules/@node-red/editor-api/lib/auth/tokens.js @@ -56,7 +56,7 @@ function expireSessions() { } if (nextExpiry < Number.MAX_SAFE_INTEGER) { // Allow 5 seconds grace - expiryTimeout = setTimeout(expireSessions,(nextExpiry - Date.now()) + 5000) + expiryTimeout = setTimeout(expireSessions,Math.min(2147483647,(nextExpiry - Date.now()) + 5000)) } if (modified) { return storage.saveSessions(sessions); @@ -129,7 +129,7 @@ module.exports = { sessions[accessToken] = session; if (!expiryTimeout) { - expiryTimeout = setTimeout(expireSessions,(accessTokenExpiresAt - Date.now()) + 5000) + expiryTimeout = setTimeout(expireSessions,Math.min(2147483647,(accessTokenExpiresAt - Date.now()) + 5000)) } return storage.saveSessions(sessions).then(function() {