Hi all, I managed to solve this issue by setting the url with ?code at the beginning of handleAuthCallback function and pass the url in client.handleRedirectCallback(this.urlFromAuth0) and add some delay to isAuthenticated$
private urlFromAuth: string;
handleRedirectCallback$ = this.auth0Client$.pipe(
concatMap((client: Auth0Client) => from(client.handleRedirectCallback(this.urlFromAuth)))
);
isAuthenticated$ = this.auth0Client$.pipe(
delay(500), // add delay to pipe
switchMap((client: Auth0Client) => from(client.isAuthenticated())),
tap(res => this.loggedIn = res)
);
private handleAuthCallback() {
// Call when app reloads after user logs in with Auth0
this.urlFromAuth0 = window.location.href;
const params = window.location.search;
...
}