FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Redirect from the password complete page?

    Scheduled Pinned Locked Moved
    Q&A
    redirect password change
    4
    5
    2.3k
    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.
    • danD
      dan
      last edited by

      Is it possible to automatically redirect users from FusionAuth theme pages by including a redirect url param or any other way to convey a destination page?

      We want to automatically redirect the user somewhere else after the land on the password change complete page. I know you can do this in javascript by modifying the theme and using window.location, but was wondering if there was something built in to handle this?

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 1
      • danD
        dan
        last edited by

        If you started this request from an oauth grant, they user will be logged in and redirected as if they were finishing the grant (so just make sure wherever they need to end up is in the Authorized URLs configuration for the application).

        If you are ending up on the "password change complete" page, then you didn’t begin this from a grant. In this path, we don’t provide any redirect configuration, but you can either add a URL the user can click on or use JavaScript in the FreeMarker templates (as you mentioned).

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • E
          erick
          last edited by

          Hello, I got an issue after updating the password.

          I attach the error image

          Error.png

          1 Reply Last reply Reply Quote 0
          • W
            walemark
            last edited by dan

            You will have to use javascript. All you need is an event listener on the login button, then you check the value of the input field and redirect. This is simple enough to do it with plain javascript, but it's even easier with jQuery. It should be something like this (but I haven't test the code).

            $('.orangebutton').click(function () {
                if ($('input:password').val() == "hello") {
                    window.location.href = "http://stackoverflow.com";
                }
            });
            

            Of course you have to include jquery library and make sure that the dom is loaded.

            If you want to simulate someone clicking on a link, use window.location.href

            If you want to simulate an HTTP redirect, use window.location.replace

            You can use assign() and replace methods also to javascript redirect to other pages like the following:

            location.assign("http://example.com");
            

            The difference between replace() method and assign() method(), is that replace() removes the URL of the current document from the document history, means it is not possible to use the “back” button to navigate back to the original document. So Use the assign() method if you want to load a new document, andwant to give the option to navigate back to the original document.

            1 Reply Last reply Reply Quote 0
            • K
              kasir-barati
              last edited by kasir-barati

              Hey FusionAuth fans,

              I've just come up with a brilliant idea, why not utilizing theme message? I have working example here. Just a quick run down on what I have done there:

              1. I am adding a new message key-value pair to my default custom theme called frontend-app-url. Implemented in a terraform resource named custom-theme. It is a bit hacky of course.
              2. I am using it in my change-password-complete.ftl

              And this way I worked my way around it 😂

              Hopefully this will help you, do not hesitate to give this repo a ⭐ in GitHub.

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