You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to create an Authentication interceptor that whenever the JWT token is expired aborts the requests since there is no need to to keep them alive if they're going to return 401 anyway. In order to do so I need a way to access either the AbortController or the abort() function in the MiddlewareOnRequestonRequest callback.
Proposal
Instantiate a new AbortController() and expose either the controller itself or its abort() function in the MiddlewareOnRequestonRequest callback.
constauthInterceptor: Middleware={asynconRequest({ request, controller, abort }){// Use either abort() or controller.abort()}}
Description
I want to create an Authentication interceptor that whenever the JWT token is expired aborts the requests since there is no need to to keep them alive if they're going to return 401 anyway. In order to do so I need a way to access either the
AbortController
or theabort()
function in theMiddlewareOnRequest
onRequest
callback.Proposal
Instantiate a
new AbortController()
and expose either the controller itself or itsabort()
function in theMiddlewareOnRequest
onRequest
callback.Example of
AbortController
usage:Checklist
The text was updated successfully, but these errors were encountered: