IONIC 6 Capacitor Android & iOS app and Azure AD auth open in external browser

I develop in Ionic 6 framework, Angular and Capacitor an App for Android & iOS. I would like to do authentication with Microsoft’s Azure AD without using Auth Connect module.I have integrated the example code at this link into my app: Tutorial: Create an Angular app that uses the Microsoft identity platform for authentication using auth code flow - Microsoft identity platform | Microsoft Docs

The app start with homepage and when I click on login button the code open Microsoft link in an external browser (example Chrome or Firefox). I do the login and when it was successful it sends me back in external browser with url localhost:8100 and it doesn’t go any further. I would like to ask if someone can help me to integrate the login function inside the app without going back to the localhost but to the home page of the app.