Checklist
Description
Similar to #429, I have a post-login action that redirects the user to my application. On that page, we collect user information and send a request to our backend to validate the input. Since the user was redirected and is not logged in, we set allowAnonymous: true on the route in the interceptor config to allow unauthenticated requests.
The issue is that the same redirect is encountered during the silent authentication performed by the interceptor and an interaction_required error is returned. This error type isn't handled in the allowAnonymous method in the interceptor, so the error is emitted by the error$ observable.
We never need this endpoint to be called with authentication, so we had a workaround of passing cacheMode: 'cache-only' to the tokenOptions setting, but that is also broken in recent versions of this library due to changes in #752 (in cache-only mode, getTokenSilently returns undefined if there is nothing in the cache so calling tokenOrResponse.accessToken throws an error).
Reproduction
- Have a post-login action that redirects the user to an application
- Set
allowAnonymous: true on an API endpoint
- Call the above endpoint from the page the user was redirected to
- The
/authorize call should return an interaction_required error
Additional context
No response
auth0-angular version
2.9.0
Angular version
21.2.x
Which browsers have you tested in?
Firefox, Chrome
Checklist
Description
Similar to #429, I have a post-login action that redirects the user to my application. On that page, we collect user information and send a request to our backend to validate the input. Since the user was redirected and is not logged in, we set
allowAnonymous: trueon the route in the interceptor config to allow unauthenticated requests.The issue is that the same redirect is encountered during the silent authentication performed by the interceptor and an
interaction_requirederror is returned. This error type isn't handled in theallowAnonymousmethod in the interceptor, so the error is emitted by theerror$observable.We never need this endpoint to be called with authentication, so we had a workaround of passing
cacheMode: 'cache-only'to thetokenOptionssetting, but that is also broken in recent versions of this library due to changes in #752 (in cache-only mode,getTokenSilentlyreturnsundefinedif there is nothing in the cache so callingtokenOrResponse.accessTokenthrows an error).Reproduction
allowAnonymous: trueon an API endpoint/authorizecall should return aninteraction_requirederrorAdditional context
No response
auth0-angular version
2.9.0
Angular version
21.2.x
Which browsers have you tested in?
Firefox, Chrome