We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30319
    • 406 Posts
    Trying to make a reset password page.
    Using code from http://rtfm.modx.com/display/ADDON/Login.ChangePassword
    If I *remove* the snippet call the page displays.
    If the snippet code is present then I get a 401/503 error.
    Site page has no ACLs on it.
    Thank you, Tom

    [[!ChangePassword?
       &submitVar=`change-password`
       &placeholderPrefix=`cp.`
       &validateOldPassword=`1`
       &validate=`nospam:blank`
    ]]
    <div class="updprof-error">[[!+cp.error_message]]</div>
    <form class="form" action="[[~[[*id]]]]" method="post">
        <input type="hidden" name="nospam" value="" />
        <div class="ff">
            <label for="password_old">Old Password
                <span class="error">[[!+cp.error.password_old]]</span>
            </label>
            <input type="password" name="password_old" id="password_old" value="[[+cp.password_old]]" />
        </div>
        <div class="ff">
            <label for="password_new">New Password
                <span class="error">[[!+cp.error.password_new]]</span>
            </label>
            <input type="password" name="password_new" id="password_new" value="[[+cp.password_new]]" />
        </div>
        <div class="ff">
            <label for="password_new_confirm">Confirm New Password
                <span class="error">[[!+cp.error.password_new_confirm]]</span>
            </label>
            <input type="password" name="password_new_confirm" id="password_new_confirm" value="[[+cp.password_new_confirm]]" />
        </div>
        <div class="ff">
            <input type="submit" name="change-password" value="Change Password" />
        </div>
    </form>



    This question has been answered by markh. See the first response.

    • discuss.answer
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      401 or 503, which one is it? tongue

      It sounds to me like you are not logged in, yet for the ChangePassword snippet to work, you need to be logged in, so it sends you to the unauthorized (401) page.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 30319
        • 406 Posts
        Ohhhhhhhhhhhhh...it says 401 in the title bar and 503 in the html code.
        I'm working as administrator user editing this page and I'm trying to view the page while editing it.
        I guess I must comment out the snippet to edit the form???
        I will test with a logged in user.
        Thank you...
          • 30319
          • 406 Posts
          That was it...need a user logged-in to make form work...I thought with admin as sudo it would work.
          I think the admin/sudo function does not quite work right for me...
          Thank you, Tom
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Sudo isn't part of the Login check probably, as Login expects a specific front end session instead of a generic "all goes" one.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 19328
              • 433 Posts
              Sorry for digging up this old thread. I had the same problem with the 401 / 504 errors. I was working with multiple contexts and forgot to add the extra context to the Login snippet:
              [[!Login? &contexts=`web,intranet`]]

              By default the user is only logged in the web context, so that's causing those errors appear on other pages. Took me hours to found that out.

              If anybody is having the same issue, and having multiple contexts; don't forget the &contexts wink