I am following the suggested login flow documented, but I am intermittently getting an error after login (with redirect) that makes it appear that the user did not log in. Subscribing to authService.error$ returns the following error only when this issue occurs:
Error: Compilation failed: Cannot overwrite `user` model once compiled.
at te.<anonymous> (auth0-spa-js.production.esm.js:1:32881)
at Generator.next (<anonymous>)
at chunk-DHZM6WDG.js?v=b79609c9:77:61
at new ZoneAwarePromise (polyfills.js:2118:23)
at __async (chunk-DHZM6WDG.js?v=b79609c9:61:10)
at te.handleRedirectCallback (auth0-spa-js.production.esm.js:1:32342)
at auth0-auth0-angular.mjs:491:41
at Observable2._subscribe (defer.js:5:19)
at Observable2._trySubscribe (Observable.js:38:25)
at Observable.js:32:31
This error is also reproducible with the angular sample app, and the angular-spa-js sample app.
Reproduction
On button click, call loginWithRedirect. Make sure to be subscribing to error$.
Login as usual through auth0 UI.
Intermittently, when redirected back to out application, the above error is throw and the user is not authenticated (isAuthenticated$ will return false).
Additional context
Using @angular version 18 (18.0.5), but have seen this issue with all version of angular from 15 through 18.
Using @auth0/auth0-angular version 2.2.3 (recently updated, but was getting the issue prior to update).
Checklist
Description
I am following the suggested login flow documented, but I am intermittently getting an error after login (with redirect) that makes it appear that the user did not log in. Subscribing to
authService.error$
returns the following error only when this issue occurs:This error is also reproducible with the angular sample app, and the angular-spa-js sample app.
Reproduction
loginWithRedirect
. Make sure to be subscribing to error$.Additional context
@angular
version 18 (18.0.5), but have seen this issue with all version of angular from 15 through 18.@auth0/auth0-angular
version 2.2.3 (recently updated, but was getting the issue prior to update).auth0-angular version
2.2.3
Angular version
18.0.5
Which browsers have you tested in?
Chrome, Edge, Safari, Firefox