@octoguide/auth-utils v1.1.5
Constants
isAuthenticated
check if the session user is authenticated
Kind: global constant
setStorageItem
generic set storage item - works in a dom context
Kind: global constant
Param | Type | Description |
---|---|---|
item | string | the storage item to set |
value | string | the storage item value |
getStorageItem
generic get storage item - works in a dom context
Kind: global constant
Param | Type | Description |
---|---|---|
item | string | the storage item to get |
removeStorageItem
generic remove storage item - works in a dom context
Kind: global constant
Param | Type | Description |
---|---|---|
item | string | the storage item to remove |
getAuth
get the auth storage item value - works in a dom context
Kind: global constant
setAuth
set the auth item in storage - works in a dom context
Kind: global constant
Param | Type | Description |
---|---|---|
auth | Object | the storage object to set |
setIdentity
set the identity item in storage - works in a dom context
Kind: global constant
Param | Type | Description |
---|---|---|
identity | Object | the storage object to set |
getIdentityRole
get the identity item role value - works in a dom context
Kind: global constant
getIdentityId
get the identity item id value - works in a dom context
Kind: global constant
getIdentityOrgId
get the identity item orgid value - works in a dom context
Kind: global constant
getIdentityName
get the identity item role name - works in a dom context
Kind: global constant
getSelectedPortfolio
get the identity item portfolio value - works in a dom context
Kind: global constant
invalidateSession
clear all session values, big reset - works in a dom context
Kind: global constant
isTokenExpired
checks if the token has expired checking against the current datetime
Kind: global constant
Param | Type | Description |
---|---|---|
token | Object | the token to validate |
extractTokenId
when the id is returned from post requests - extract the id to put back into the payload
Kind: global constant
isSuperUser
checks if the current identity role is super user
Kind: global constant
isAdmin
checks if the current identity role is admin
Kind: global constant
isOrg
checks if the current identity id is the organaisation - not an employee
Kind: global constant
getRoleName
gets the current identity role
Kind: global constant
generateGuid
generate a unique record uid
Kind: global constant
getBasicAuthorizationHeader
generate a basic auth header
Kind: global constant
Param | Type | Description |
---|---|---|
username | string | the username to use |
password | string | the password to use |