diff --git a/config/default.js b/config/default.js index bd492b5fe5..7a13130ea4 100644 --- a/config/default.js +++ b/config/default.js @@ -78,16 +78,6 @@ module.exports = { }, }, - /* Amount of time [seconds] before expiration of authentication tokens, - * when the frontend will automatically trigger their refreshment. Once - * ready, it will either write to the Redux store fresh token, or will - * remove auth tokens from the store. - * NOTE: With the current implementation of accounts-app this value must be - * smaller than 60 seconds (earlier than 60 seconds before expiration of an - * auth token, a call to the getFreshToken() method returns the old token, - * due to caching). */ - REAUTH_TIME: 55, - /* API key for Segment.io. For development environment the value is set inside * development.json, for production environment it is set via CircleCI * variables. */ diff --git a/src/client/index.jsx b/src/client/index.jsx index 62f6f7063d..fa47d92f3d 100644 --- a/src/client/index.jsx +++ b/src/client/index.jsx @@ -107,17 +107,6 @@ function authenticate(store) { store.dispatch(actions.direct.dropAll()); store.dispatch(actions.groups.dropGroups()); } - - /* Automatic refreshment of auth tokens. */ - let time = Number.MAX_VALUE; - if (tctV2) time = decodeToken(tctV2).exp; - if (userV3) time = Math.min(time, userV3.exp); - if (time < Number.MAX_VALUE) { - time = 1000 * (time - window.CONFIG.REAUTH_TIME); - time = Math.max(0, time - Date.now()); - logger.log('Reauth scheduled in', time / 1000, 'seconds'); - setTimeout(() => authenticate(store), time); - } }); }