Skip to content

Commit

Permalink
cleanup diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
ncovercash committed Sep 24, 2024
1 parent 89629a2 commit cbd03ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Root/FFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/components/Root/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/loginServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit cbd03ca

Please sign in to comment.