If provided, no calls to the JwtApi.login will be made, until the action is dispatched. The action is expected to come after dispatching login action of this package. Used to wait until, for example, the socket is open, if the auth request is supposed to be sent through the socket.
Used by the JwtInterceptor http interceptor to set the auth header with jwt pinned for every request.
Urls, which will not be intercepted. If string, the url should start with that string to be excluded. If RegExp, the url will be tested with .match and excluded if matches.
Provides methods to interact with backend. Must implement JwtApi.
if set, the JwtGuard, used to restrict access for unauthorized users, will be provided and available to be used in the routing. To implement redirection, when no JWT available, use noFreshJwt field of this config.
The action on which navigation will be cancelled. The default is loginAgainErrored
.
The action on which navigation will be continued. The default is loginAgainSucceed
.
Used to call JwtApi.login, if there are valid JWT.
fresh JWT.
the key to be used in the localStorage.
Default is defaultJwtStorageKey
Used to start actions, when refresh jwt failed. Usually you want to redirect user to the login page.
If all fields are false, NoFreshJwtListener is never called. If you want to navigate to the auth page every time a JWT needed, but there was none, set all fields to true.
Generated using TypeDoc
Main configuration object. Describes, how to retrieve JWT, UserInfo, what to do when JWTs are invalid, how JwtGuard will handle routes.