import { UserManager , WebStorageStateStore , InMemoryWebStorage , UserManagerSettings , } from 'oidc-client' ; import { oidcLog } from './loggerService' ; let userManager ; export const setUserManager = ( userManagerToSet ) => { userManager = userManagerToSet ; } ; export const getUserManager = ( ) => userManager ; export type UserStoreType = any ; export const authenticationServiceInternal = ( WebStorageStateStoreInt ) => ( configuration , UserStore ? ) => { if ( userManager ) { return userManager ; } const overriddenConfiguration = { ... configuration } ; if ( UserStore ) { overriddenConfiguration . userStore = new WebStorageStateStoreInt ( { store : new UserStore ( ) } ) ; } userManager = new UserManager ( overriddenConfiguration ) ; return userManager ; } ; export const authenticationService = authenticationServiceInternal ( WebStorageStateStore ) ; export { InMemoryWebStorage } ;