Impossible to redirect user after logout ionic + angular

Hello everyone,

I’m looking for the correct method to logout user in ionic auth0 application.
First try:
`

this.auth.logout({ returnTo: callbackUri, localOnly: false });

`
It’s working on Google Chrome but not with an android device.

Second try:

this.auth
.buildLogoutUrl({ returnTo: callbackUri })
.pipe(
tap((url) => {
// Call the logout fuction, but only log out locally
this.auth.logout({ localOnly: true });
// Redirect to Auth0 using the Browser plugin, to clear the user’s session
Browser.open({ url });
})
)
.subscribe();

This method opens a new tab on google Chrome.
Open a blank page (for 2 sec and vanish) in android device but I have to quit the app and go back to see the changes.

My goal is to logout user and go back to auth0 custom login or my main page who has a guard and will redirects to auth0 login page.

Please help me :slight_smile:

1 Like

[UPDATE]:
Logout is working but not the redirection…
I have put my callbackUri which is correct : ${appId}://${auth0Domain}/capacitor/${appId}/callback
But I stay on the same page after logout successfull…

Up!
Is there Someone?

I believe I am having the same issue. Can logout, but the redirect doesn’t work. If I restart the app, it takes me to the login screen, but I do need to close and restart the app.

I’m using react and trying to do the same thing where the logout should reroute back to the app, the app then should call the login page as the user shouldn’t be authenticated

I have de them issue, after logout, the universal login from auth0 opens again. I can’t go back to ‘/’.