Auth0 Logout stopped working after angular update

16 views Asked by At

the following code use to work just fine on angular version 14. (i updated to 17 today because i kept getting dependency issues.)

logout(): void {
    sessionStorage.clear();
    this.auth.logout({ returnTo: window.location.origin });
  }

however, the returnTo part of this code is no underlined in red and says the following: Object literal may only specify known properties, and 'returnTo' does not exist in type 'Omit<LogoutOptions, "onRedirect">'.ts(2353)

I have tried to ask ChatGPT to solve this issue and it came up with this solution:

  logout(): void {
    sessionStorage.clear();
    this.auth.logout({ returnTo: window.location.origin } as any);
  }

this gets rid of the annoying red line, however, when i try to login, i get the following error:

Unable to issue redirect for OAuth 2.0 transaction

Can anyone come up with a reason for why this is happening?

0

There are 0 answers