React + Capacitor (only mobile experience) redirect to specific page after login

Hi folks!
I need an help to understand what I’m doing wrong.
I following this guide and working well on the browser, after login the user redirect to target page.
When I performing the app on an android or ios emulator the behaviour is different.
After login return to login page instead target page.


const App: React.FC = () => {
  const { handleRedirectCallback } = useAuth0();

  useEffect(() => {
    CapApp.addListener("appUrlOpen", async ({ url }) => {
      if (url.startsWith(callbackUri)) {
        if (
          url.includes("state") &&
          (url.includes("code") || url.includes("error"))
        ) {
          await handleRedirectCallback(url);

        await Browser.close();
  }, [handleRedirectCallback]);

  return (
          <Route exact path="/" component={Login} />
          <Route path="/tab" component={AppTabs} />

export default App;


const appId = "gymnasium.ionic";
const auth0Domain = domain;
const iosOrAndroid = isPlatform("hybrid");

export const callbackUri = iosOrAndroid
  ? `${appId}://${auth0Domain}/capacitor/${appId}/tab`
  : "http://localhost:8100/tab";

AndroidManifest.xml (partial code)

<!--Add configurations @capacitor/app-->
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="@string/custom_url_scheme" />


<?xml version='1.0' encoding='utf-8'?>
    <string name="app_name">gymnasium-ionic</string>
    <string name="title_activity_main">gymnasium-ionic</string>
    <string name="package_name">gymnasium.ionic</string>
    <string name="custom_url_scheme">gymnasium.ionic</string>

Info.plist (partial code)

	<!--Add configurations @capacitor/app-->

And last but not least the auth0 Allowed Origins (CORS) and Allowed Callback URLs

Can someone help me? Why on the mobile emulator not working as desired?