NbTokenService
Service that allows you to manage authentication token - get, set, clear and also listen to token changes over time.
Methods
Name | Description |
clear() | returns: Observable<null> Removes the token and published token value |
get() | returns: Observable<NbAuthToken> Returns observable of current token |
set() | parameters: token: returns:NbAuthToken Observable<null> Sets a token into the storage. This method is used by the NbAuthService automatically. |
tokenChange() | returns: Observable<NbAuthToken> Publishes token when it changes. |
NbAuthSimpleToken
Wrapper for simple (text) token
Methods
Name | Description |
getCreatedAt() | returns: Date Returns the token's creation date |
getValue() | returns: string Returns the token value |
isValid() | returns: boolean Is non empty and valid |
toString() | returns: string Validate value and convert to string, if value is not valid return empty string |
NbAuthJWTToken
Wrapper for JWT token with additional methods.
Methods
Name | Description |
getTokenExpDate() | returns: Date
Returns expiration date |
isValid() | returns: boolean Is data expired |
parsePayload() | returns: void Returns payload object |
prepareCreatedAt() | parameters: date: returns:Date Date for JWT token, the iat (issued at) field of the token payload contains the creation Date |
Need some help or found an issue?
Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.