auth/index
@boldpenguin/sdk-redux › Globals › "auth/index"
Index
Variables
- getEmail
- getFirstName
- getLastName
- getName
- getRefreshCount
- getTenantLogo
- getTenantName
- getTenantThemeName
- getTerminalTheme
- getUserId
- isUserAuthenticated
- selectAuthExpiration
- selectToken
- selectTokenExpiration
- selectUser
Functions
Variables
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
Const getTenantLogo
• 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 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(selectAuthExpiration, (authExpiration) => { return authExpiration > Date.now(); })
Returns whether user authentication expires in the future and whether the user is (likely) still authenticated
param
returns
Const selectAuthExpiration
• selectAuthExpiration: 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 selectToken
• selectToken: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth?.token)
Returns the authenticated user token
param The BpSdk Redux store
Const selectTokenExpiration
• selectTokenExpiration: 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 selectUser
• selectUser: 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
Functions
Const getAuth
▸ getAuth(state: BpSdkStore): IAuthState
Returns the entire auth state
Parameters:
| Name | Type | Description |
|---|---|---|
state | BpSdkStore | The BpSdk Redux store |
Returns: IAuthState