Whether current JWT was obtained through loginAs function.
Readonly access to the JWT. Probably you should use withFreshJwt.
Returns the difference between the number of successful loginAs calls and logout calls.
Use this method with caution! You are supposed to delete JWT only via logout! WILL NOT deactivate session or clear UserInfo from AppStore, only deletes locally stored JWT!
Makes a call to the JwtApi.login, but handles the jwt in response.
Makes a call to the JwtApi.loginAs, but handles the jwt in response. loginAs endpoint MUST have fresh JWT in auth response.
Logs out the current user. If there was loginAs call previously (perhaps multiple calls), will restore the JWT of the user, that called loginAs. Makes a call to the JwtApi.logout, but handles the jwt in response. If the refresh token is expired or there is no tokens, will return immediately.
Refreshes the tokens if needed and calls the callback, when the tokens refreshed successfully. If the tokens are not refreshable, the callback is called without any arguments and the JwtConfig.noFreshJwt is also called
If you want the callback to be called only with fresh tokens, pass true
as the second parameter.
The function to be called after JWT were refreshed.
If true, the callback will not be called when JWT are not refreshable.
If true, NoFreshJwtListener will not be notified about the JWT absence.
Generated using TypeDoc
Refreshes the tokens if needed and emits them as a value. If no fresh tokens available, will emit
undefined
. The first subscription will call withFreshJwt, but later subscribers will receive the same value.