feat(core): Custom session timeout and refresh configuration (#8342)

This commit is contained in:
Danny Martini
2024-01-22 09:54:13 +01:00
committed by GitHub
parent f4f496ae85
commit 07e6705256
9 changed files with 299 additions and 13 deletions

View File

@@ -103,6 +103,7 @@ export const UM_FIX_INSTRUCTION =
/**
* Units of time in milliseconds
* @deprecated Please use constants.Time instead.
*/
export const TIME = {
SECOND: 1000,
@@ -111,6 +112,28 @@ export const TIME = {
DAY: 24 * 60 * 60 * 1000,
} as const;
/**
* Convert time from any unit to any other unit
*
* Please amend conversions as necessary.
* Eventually this will superseed `TIME` above
*/
export const Time = {
seconds: {
toMilliseconds: 1000,
},
minutes: {
toMilliseconds: 60 * 1000,
},
hours: {
toMilliseconds: 60 * 60 * 1000,
toSeconds: 60 * 60,
},
days: {
toSeconds: 24 * 60 * 60,
},
};
export const MIN_PASSWORD_CHAR_LENGTH = 8;
export const MAX_PASSWORD_CHAR_LENGTH = 64;