Skip to main content

auth/index

@boldpenguin/sdk-reduxGlobals"auth/index"

Index

Variables

Functions

Variables

Const getAuthExpiration

getAuthExpiration: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.expiresAt ?? Date.now() - 1)

Returns the authentication expiration in Unix time

param The BpSdk Redux store


Const getEmail

getEmail: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.email)

Returns the current active user email

param The BpSdk Redux store


Const getFirstName

getFirstName: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.firstName)

Returns the current active user first name

param The BpSdk Redux store


Const getLastName

getLastName: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.lastName)

Returns the current active user last name

param The BpSdk Redux store


Const getName

getName: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.name)

Returns the current active user name

param The BpSdk Redux store


Const getRefreshCount

getRefreshCount: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.refreshCount)

Returns refresh count

param The BpSdk Redux store


getTenantLogo: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.tenantLogoUrl)

Returns the current active user tenant logo

param The BpSdk Redux store


Const getTenantName

getTenantName: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.tenantName)

Returns the current active user tenant name

param The BpSdk Redux store


Const getTenantThemeName

getTenantThemeName: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.tenantTheme)

Returns the current active user tenant theme

param The BpSdk Redux store


Const getTerminalTheme

getTerminalTheme: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.terminalTheme)

Returns the current active user theme object

param The BpSdk Redux store


Const getToken

getToken: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.token)

Returns the authenticated user token

param The BpSdk Redux store


Const getTokenExpiration

getTokenExpiration: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.expiresAt ?? Date.now() - 1)

Returns the authentication expiration in Unix time

param The BpSdk Redux store


Const getUser

getUser: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.user)

Returns the authenticated user from the store, or undefined if not authenticated

param The BpSdk Redux store


Const getUserId

getUserId: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.userId)

Returns the current active user ID

param The BpSdk Redux store


Const isUserAuthenticated

isUserAuthenticated: function & OutputSelectorFields‹function› & object = createSelector(getAuthExpiration, (authExpiration) => { return authExpiration > Date.now(); })

Returns whether user authentication expires in the future and whether the user is (likely) still authenticated

param

returns

Functions

Const getAuth

getAuth(state: BpSdkStore): IAuthState

Returns the entire auth state

Parameters:

NameTypeDescription
stateBpSdkStoreThe BpSdk Redux store

Returns: IAuthState