Problem with Ionic InAppBrowser

I’m using Ionic 5 + Angular to develop a proprietary mobile application. For signing in I’m using a local SSO server and appauth (package ionic-appauth from NPM).

Sometimes, when the app needs to fetch a token from the server, if a request fails then the app gets stuck in the InAppBrowser and does not get redirected back, displaying only a white screen. If I inspect the app through the developer tools then I see it says that “Chrome” is open and the page title is “untitled”.

Is there anyway to go around this issue?

Hi @DamjanD1
bad news.
We stuck in the same problem. After several days looking around we found the reason of the problem

When you try to login the system redirect to browser (the capacitor browser). In Android, capacitor has a bug: browser cannot be closed.
We are trying to find a workaround but it’s very hard