Git Merge Request #301: Add JS validation for passwords (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Shalitha Suranga wants to merge 6 commits from /u/shalithasuranga/allura/ to master, 2018-10-22

Fix for [#7459]

This will display validation messages as we discussed in ticket. I used keyup event. And since code will duplicate in two location I separated to js file and used as ew resource

Commit Date  
[d5e807] (patch4) by Shalitha Shalitha

[#7459] Remove unused extra_js snippet

2018-10-20 11:17:59 Tree
[9de3f2] by Shalitha Shalitha

[#7459] Change wording for message

2018-10-20 11:15:15 Tree
[ad7883] by Shalitha Shalitha

[#7459] Add JS validation for pass reset and use from config

2018-10-20 11:14:00 Tree
[ae4e7a] by Shalitha Shalitha

Merge branch 'patch4' of https://forge-allura.apache.org/git/u/shalithasuranga/allura into patch4

2018-10-20 09:44:32 Tree
[5f04bb] by Shalitha Suranga Shalitha Suranga

[#7459] Typo fix for message

2018-10-19 06:29:54 Tree
[1ec584] by Shalitha Suranga Shalitha Suranga

[#7459] Added JS password validation

2018-10-19 06:13:22 Tree

Discussion

  • Dave Brondsema

    Dave Brondsema - 2018-10-19

    This is nice! And good usage of an easywidgets resource.

    The attrs min & max should get config values like a few lines below it: asint(tg.config.get('auth.min_password_len', 6) This lets site administrators configure different requirements if they wish.

    I would adjust the wording a little bit, like: "Password must have between _ and _ characters"

    And one more place that could use this is the forgotten password recovery form (when you click forgot password, and then get a link in email to reset your password). That form uses PasswordChangeBase (parent of PasswordChangeForm)

     
    • Okay sure I will push those changes.

      Btw can we remove this code block in create_account.html I found that it is not used

      {% block extra_js %}
        <script type="text/javascript">
          /*<![CDATA[*/
          $('#create_account').submit(function () {
            if (!$('#username').attr('value').match(/^[a-zA-Z0-9]+$/)) {
              alert('Username can only contain numbers and letters.');
              return false;
             ..........................
             ............
      
       
      • Dave Brondsema

        Dave Brondsema - 2018-10-19

        Yea sounds good to me

         
        • Updated MR with above changes.

           
  • Dave Brondsema

    Dave Brondsema - 2018-10-22
    • Status: open --> merged
     

Log in to post a comment.