79700: Auto-refreshing the token & Needed config

This commit is contained in:
Marie Verdonck
2021-05-28 10:33:51 +02:00
parent de8e306d9f
commit b23522d39f
6 changed files with 90 additions and 24 deletions

View File

@@ -2,7 +2,6 @@ import { GlobalConfig } from '../config/global-config.interface';
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
import { BrowseByType } from '../app/+browse-by/+browse-by-switcher/browse-by-decorator';
import { RestRequestMethod } from '../app/core/data/rest-request-method';
import { BASE_THEME_NAME } from '../app/shared/theme-support/theme.constants';
export const environment: GlobalConfig = {
production: true,
@@ -43,6 +42,25 @@ export const environment: GlobalConfig = {
timePerMethod: {[RestRequestMethod.PATCH]: 3} as any // time in seconds
}
},
// Authority settings
auth: {
// Authority UI settings
ui: {
// the amount of time before the idle warning is shown
// timeUntilIdle: 15 * 60 * 1000, // 15 minutes
timeUntilIdle: 1 * 60 * 1000, // 1 minutes
// the amount of time the user has to react after the idle warning is shown before they are logged out.
// idleGracePeriod: 5 * 60 * 1000, // 5 minutes
idleGracePeriod: 1 * 60 * 1000, // 1 minutes
},
// Authority REST settings
rest: {
// If the rest token expires in less than this amount of time, it will be refreshed automatically.
// This is independent from the idle warning.
// timeLeftBeforeTokenRefresh: 2 * 60 * 1000, // 2 minutes
timeLeftBeforeTokenRefresh: 0.25 * 60 * 1000, // 25 seconds
},
},
// Form settings
form: {
// NOTE: Map server-side validators to comparative Angular form validators
@@ -267,8 +285,8 @@ export const environment: GlobalConfig = {
],
// Whether the UI should rewrite file download URLs to match its domain. Only necessary to enable when running UI and REST API on separate domains
rewriteDownloadUrls: false,
// Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with "image" or "video").
// For images, this enables a gallery viewer where you can zoom or page through images.
// Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with "image" or "video").
// For images, this enables a gallery viewer where you can zoom or page through images.
// For videos, this enables embedded video streaming
mediaViewer: {
image: false,