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 mod_rewrite equilivant

    Help
    2
    2
    884
    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.
    • metcarob
      metcarob last edited by

      Hi,
      I have a second problem when getting google auth to call back to the quasar site.

      google auth won’t accept localhost:8080/#/auth/google as a redirect url.
      It complains about the #
      So I am trying to get the ‘quasar dev’ command to redirect a request to localhost:8080/auth/google to localhost:8080/#/auth/google

      This is only a dev machine so no apache or ngnix in front of the server.

      Is there a way to do this?

      One idea I have is to have a beforeEnter: handler connected to ‘/’ This is being called.
      If I can determine the URL inside this function I should be able to write an if statement to do the redirection:

      I have the following function :
      function requireAuth (to, from, next) {
      console.log(‘requireAuth’)
      console.log(to)
      console.log(from)
      console.log(next)
      // Other code removed
      }

      It is picked up however none of the to, from and next parameters contain the url path of the incoming request. (I am going to localhost:8080/auth/google)

      It might be possible for me to do something like

      if (incommingURL === ‘/auth/google’) {
      next({
      path: ‘/auth/google’,
      query: { redirect: to.fullPath }
      })
      }

      Would this work? Would this preserve other parameters passed in the URL. (I need the token that google is passing me)

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        The difference between an URL with hash (#/auth/google - notice the hash symbol at beginning) or with paths (like /auth/google) is how you configure the Vue Router: on hash mode or history mode.

        So, read about Vue Router: https://router.vuejs.org/en/essentials/history-mode.html
        And read about what changing from one mode (default is hash mode) to another (you probably want history mode) might affect the way Webpack handles static assets: http://quasar-framework.org/guide/app-handling-static-assets.html

        Basically when running the dev server, you are running an express instance (see /build/script.dev.js). Change whatever you see fit in /build to match your requirements.

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