Refreshing SPA logs in user when refreshing page

I’m creating an Angular SPA using Auth0 for authentication, and using the Quickstart implementation it seems to be working properly.
However, I need to use the Auth0 user data to pull data from a different API to get additional user info I need for the website. I’ve done this by using a pipe to make a call after calling the Auth0 user observable, but the issue I’m having is when I do this, after I log out, if I refresh the page, it logs in again to the previous user.

This is the code:

public initializeProfile(): any {
return this.auth.user$.pipe(
tap(res => this.userAuth = res),
concatMap(res => + “userProfile”, {
authId: res?.sub,
roles: res?.roles
).subscribe(res => this.userProfile = res);

As long as I include the API call inside the concatMap, this is what triggers it.
I have this function as a Resolve because I don’t want to lose the user’s data when I refresh the page,.

I hope my problem is explained properly and hope someone can answer why I can’t keep a user logged out.