All subscriptions emits on signOut()
Hi,
I have a problem with observables in my application when a user signs out.
All HTTP requests that once has been requested gets emitted again when firebase.signOut() is called.
Lets say I make two HTTP requests to my API; one to api/customers and one to api/locations. As soon as the user logs out, both of the HTTP requests are sent again.
The issue can be solved with data.getLocations().pipe(first()).subscribe(...), but why do firebase.signOut() cause this problem?
This is my code:
getLocations() {
this.data.getLocations().subscribe({
next: (res) => {
console.log('res');
this.locations = res;
},
error: (err) => {
console.log(err);
this.locations = [];
}
})
}
The console.log('res'); is shown in the console and the requests are added in the Network tab.
Im using Angular 15 and Angularfire 7.5.0.
This issue does not seem to follow the issue template. Make sure you provide all the required information.