From cbd03ca6151f56abb2e6e64303f58363694269c6 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Tue, 24 Sep 2024 18:29:40 -0400 Subject: [PATCH] cleanup diffs --- src/components/Root/FFetch.js | 4 ++-- src/components/Root/constants.js | 2 +- src/loginServices.js | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Root/FFetch.js b/src/components/Root/FFetch.js index db68adefd..d4eb92b9e 100644 --- a/src/components/Root/FFetch.js +++ b/src/components/Root/FFetch.js @@ -133,7 +133,7 @@ export class FFetch { // RT timeout interval (session will end) and warning interval (warning that session will end) const rtTimeoutInterval = (rotationInterval.refreshTokenExpiration - Date.now()); - const rtWarningInterval = (rotationInterval.refreshTokenExpiration - Date.now()) - ms(this.rtrConfig.fixedLengthSessionWarningTTL); + const rtWarningInterval = (rotationInterval.refreshTokenExpiration - Date.now()) - ms(config.rtr.fixedLengthSessionWarningTTL); // schedule AT rotation IFF the AT will expire before the RT. this avoids // refresh-thrashing near the end of the FLS with progressively shorter @@ -149,7 +149,7 @@ export class FFetch { } // schedule FLS end-of-session warning - this.logger.log('rtr-fls', `end-of-session warning at ${new Date(rotationInterval.refreshTokenExpiration - ms(this.rtrConfig.fixedLengthSessionWarningTTL))}`); + this.logger.log('rtr-fls', `end-of-session warning at ${new Date(rotationInterval.refreshTokenExpiration - ms(config.rtr.fixedLengthSessionWarningTTL))}`); this.store.dispatch(setRtrFlsWarningTimeout(setTimeout(() => { this.logger.log('rtr-fls', 'emitting RTR_FLS_WARNING_EVENT'); window.dispatchEvent(new Event(RTR_FLS_WARNING_EVENT)); diff --git a/src/components/Root/constants.js b/src/components/Root/constants.js index 58b530c3d..ff4a2b4a1 100644 --- a/src/components/Root/constants.js +++ b/src/components/Root/constants.js @@ -33,7 +33,7 @@ export const RTR_FLS_WARNING_TTL = '1m'; export const RTR_ACTIVITY_CHANNEL = '@folio/stripes/core::RTRActivityChannel'; /** - * how much of a token's lifespan can elapse before it is considered expired. + * how much of a token's lifespan can elapse before it is considered expired? * For the AT, we want a very safe margin because we don't ever want to fall * off the end of the AT since it would be a very misleading failure given * the RT is still good at that point. Since rotation happens in the background diff --git a/src/loginServices.js b/src/loginServices.js index ca66a607d..060f52dd4 100644 --- a/src/loginServices.js +++ b/src/loginServices.js @@ -28,7 +28,9 @@ import { } from './okapiActions'; import processBadResponse from './processBadResponse'; -import { RTR_TIMEOUT_EVENT } from './components/Root/constants'; +import { + RTR_TIMEOUT_EVENT +} from './components/Root/constants'; // export supported locales, i.e. the languages we provide translations for export const supportedLocales = [