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 have some requests that I'd like to bypass the Auth0 AuthHttpInterceptor, and skipping them by matching on URL string using a uriMatcher in the configuration isn't ideal.
It is possible to match these endpoints by their URL strings, but that requires configuring the interceptor in a completely separate area of code from where this is necessary, making the code difficult to understand. And while our current use case doesn't require the ability to do that based on any other state, I could easily imagine a situation where we might want to skip the interceptor based on some condition other than the URL of the endpoint in use.
Describe the ideal solution
Ideally it would be possible to mark a request to be skipped by adding an HttpContextToken to the request context, as described here: https://bradleycarey.com/posts/bypass-angular-interceptor/. This would take just a few lines of code, would be easy to test, and solves the problem in a very simple way.
If the maintainers are interested in adding this functionality, I might be willing to create a PR myself.
Alternatives and current workarounds
It would certainly be possible for us to implement this on our own by wrapping the AuthHttpInterceptor in our own interceptor, and I've considered doing that instead of URL matching. If the maintainers of this library would prefer not to build this in, we may end up doing that for our app in the future. But this seems like such a simple and powerful improvement to the functionality of the base library that I'd like to avoid having to do that.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe the problem you'd like to have solved
I have some requests that I'd like to bypass the Auth0 AuthHttpInterceptor, and skipping them by matching on URL string using a uriMatcher in the configuration isn't ideal.
It is possible to match these endpoints by their URL strings, but that requires configuring the interceptor in a completely separate area of code from where this is necessary, making the code difficult to understand. And while our current use case doesn't require the ability to do that based on any other state, I could easily imagine a situation where we might want to skip the interceptor based on some condition other than the URL of the endpoint in use.
Describe the ideal solution
Ideally it would be possible to mark a request to be skipped by adding an HttpContextToken to the request context, as described here: https://bradleycarey.com/posts/bypass-angular-interceptor/. This would take just a few lines of code, would be easy to test, and solves the problem in a very simple way.
If the maintainers are interested in adding this functionality, I might be willing to create a PR myself.
Alternatives and current workarounds
It would certainly be possible for us to implement this on our own by wrapping the AuthHttpInterceptor in our own interceptor, and I've considered doing that instead of URL matching. If the maintainers of this library would prefer not to build this in, we may end up doing that for our app in the future. But this seems like such a simple and powerful improvement to the functionality of the base library that I'd like to avoid having to do that.
Additional context
No response
The text was updated successfully, but these errors were encountered: