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

    Handling form POST from another site.

    Help
    2
    4
    982
    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.
    • J
      jeffatpf last edited by

      All, I’m totally aware that this is not a quasar specific question - it’s much more related to Vue.js and Vue-Router, but I’d like to ask it here because I’ve found this forum very helpful in the past, and I’m very appreciative that this community is here.

      Our site needs to handle a login form on an external third party site - totally unrelated from our Vue.js/Quasar built site. Submitted form elements are a username and password. The external site is doing a POST to a page on our site.

      <form id=“loginForm” method=“post” action=“http://www.mysite.com/siteLogin” onsubmit=“return setParamStatus();”>
      <input type=“text” autocomplete=“off” id=“userid” name=“userid” size=“23” maxlength=“18” placeholder=“Username”>
      <input type=“password” id=“password” name=“password” size=“23” maxlength=“18” placeholder=“Password”>
      <input type=“image” src="./loginButton.jpg" width=“97” height=“31” alt=“Sign in” id=“submitBtn”>
      </form>

      In my routes.js I’m defining

        {
          path: '/siteLogin',
          name: 'Site Login',
          component: () => import('components/home/siteLogin'),
          props: (route) => ({
            params: route.params
          })
        }
      

      But it’s not working. I’m getting a ‘cannot /POST’ message in the browser.

      I’d like to get to the params field from within siteLogin.vue and do the login/etc with the username/password.

      So the big question is how can I get to the form POST parameters (username, password) from within a Vue.js component/page?

      Any help would be appreciated.

      Thanks, Jeff.

      1 Reply Last reply Reply Quote 0
      • J
        jeffatpf last edited by

        Any help would be appreciated.

        1 Reply Last reply Reply Quote 0
        • M
          Max last edited by

          hey @jeffatpf … you have to differentiate between backend & frontend routing. vue-router is only in the browser…
          but sending a html form requires a backend handler like in php python etc… the browser then sends the form data to your backend…

          1 Reply Last reply Reply Quote 0
          • J
            jeffatpf last edited by

            I figured this out, it was not possible (nor did it make sense) to implement it in the manner with which I hoped/envisioned. A mix of backend/cookies/frontend did the trick.

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