No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    quasar-dev localhost for capacitor apps

    CLI
    4
    4
    973
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • aitcheyejay
      aitcheyejay last edited by

      Currently, the quasar-dev library overtly translates the host designation of “localhost” to the an IP address (invoking getExternalIP() and displaying “⚠️ Detected external IP xxx.xxx.xxx.xxx and using it” on startup). I’m not entirely sure what the thought process is behind the business logic as “localhost”, “127.0.0.1”, “0.0.0.0”, and “::1” are all translated to IP address.

      The problem is, as best I can tell, it isn’t possible to run a Capacitor app in dev mode using a dynamically allocated IP when invoking Google OAuth. Google OAuth requires whitelisting a source to allow the auth call to function. Failure to do so induces the error “Not a valid origin for the client: http://xxx.xxx.xxx.xxx:yyyy has not been whitelisted for client ID zzz.apps.googleusercontent.com. Please go to https://console.developers.google.com/ and whitelist this origin for your project’s client ID.” IPs are not acceptable in the whitelist section and a variety of workarounds do not appear to help. However, forcing the host to “localhost” without translating to an IP address and adding “http://localhost” to the Google OAuth whitelist works perfectly. Unfortunately, this required a hack of the quasar-dev codebase on my part.

      What I’m suggesting is that there should be a simple way to force Capacitor to use “localhost”.

      Thoughts?

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @aitcheyejay last edited by

        @aitcheyejay said in quasar-dev localhost for capacitor apps:

        Unfortunately, this required a hack of the quasar-dev codebase on my part.

        could you share this ‘hack’?

        1 Reply Last reply Reply Quote 0
        • F
          FloatingPoint last edited by

          I think the IP is required for hot loading. However, I do think there’s a need to be able to assume a domain or localhost to make a Google OAuth whitelist work. Tried a bunch of approaches without any luck.

          Perhaps this is just a need to work out Google OAuth whitelisting in dev mode.

          1 Reply Last reply Reply Quote 0
          • B
            botura last edited by

            @aitcheyejay , can you share the hack?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post