Skip to content

Remove reauth from community-app #4958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
11 changes: 0 additions & 11 deletions src/client/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down