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:NbAuthTokenObservable<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: DateReturns the token's creation date |
| getValue() | returns: stringReturns the token value |
| isValid() | returns: booleanIs non empty and valid |
| toString() | returns: stringValidate 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: booleanIs data expired |
| parsePayload() | returns: voidReturns payload object |
| prepareCreatedAt() | parameters: date: returns:DateDatefor 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.
