Previously, the code worked flawlessly on Angular version 14. However, after updating to version 17 due to persistent dependency issues, a problem arose.
logout(): void {
sessionStorage.clear();
this.auth.logout({ returnTo: window.location.origin });
}
The issue now is that the 'returnTo' part of the code is underlined in red with the following error message:
Object literal may only specify known properties, and 'returnTo' does not exist in type 'Omit<LogoutOptions, "onRedirect">'.ts(2353)
I attempted to seek help from ChatGPT to resolve this problem and it suggested the following solution:
logout(): void {
sessionStorage.clear();
this.auth.logout({ returnTo: window.location.origin } as any);
}
Although the red underline is removed with this modification, it results in an error when attempting to log in:
Unable to issue redirect for OAuth 2.0 transaction
Is there anyone who can provide insights into why this error occur?