diff --git a/package-lock.json b/package-lock.json index 3c32c5b16..3ce8df208 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "name-request", - "version": "5.3.3", + "version": "5.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "name-request", - "version": "5.3.3", + "version": "5.3.4", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/breadcrumb": "2.1.24", diff --git a/package.json b/package.json index 90e0a3d7d..4595acf4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "name-request", - "version": "5.3.3", + "version": "5.3.4", "private": true, "appName": "Name Request UI", "sbcName": "SBC Common Components", diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index 90ee4ffd5..a4883e1e1 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -12,6 +12,7 @@ export * from './models' export * from './name-check-interfaces' export * from './dialog-options' export * from './refund-params-interface' +export * from './root-state-interface' // external interfaces export type { diff --git a/src/interfaces/root-state-interface.ts b/src/interfaces/root-state-interface.ts new file mode 100644 index 000000000..13b477f48 --- /dev/null +++ b/src/interfaces/root-state-interface.ts @@ -0,0 +1,8 @@ +/** The ROOT state model interface. */ +export interface RootStateIF { + auth: { + token: string, + idToken: string, + refreshToken: string + } +} diff --git a/src/store/getters.ts b/src/store/getters.ts index 43fa6ff6b..c1670eabe 100644 --- a/src/store/getters.ts +++ b/src/store/getters.ts @@ -21,6 +21,7 @@ import { RequestNameI, RequestOrConsentIF, ReservedReqI, + RootStateIF, SelectOptionsI, StaffPaymentIF, StateIF, @@ -67,8 +68,8 @@ export const isMobile = (state: StateIF): boolean => { } /** True if user is authenticated, else False. */ -export const isAuthenticated = (): boolean => { - return Boolean(sessionStorage.getItem(SessionStorageKeys.KeyCloakToken)) +export const isAuthenticated = (rootState: RootStateIF): boolean => { + return Boolean(rootState.auth?.token) } export const getCurrentJsDate = (state: StateIF): Date => {