From 5f5aaf450a082e0b00ed1752e32448a5ee649aa6 Mon Sep 17 00:00:00 2001 From: Harsha Murthy Date: Fri, 16 Mar 2018 09:30:00 -0500 Subject: [PATCH] Remove top 100 passwords check due to deprecated link (#121) (#122) --- app/assets/javascripts/password.js | 38 +++++++++++++++--------------- app/views/passwords/edit.html.erb | 2 +- app/views/users/new.html.erb | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/password.js b/app/assets/javascripts/password.js index 45dc088..f7314a0 100644 --- a/app/assets/javascripts/password.js +++ b/app/assets/javascripts/password.js @@ -54,27 +54,27 @@ $(document).on('turbolinks:load', function() { return password.length >= 10 } - window.checkTop100 = function(password) { - if (!window.top100) { - getTop100().then(function() { - return !window.top100.includes(password) - }) - } else { - return !window.top100.includes(password) - } - - } - - function getTop100() { - return $.ajax({ - url: 'https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/10_million_password_list_top_100.txt' - }).then(function(data) { - window.top100 = data - }) - } - window.ensureDoesntMatchEmail = function(password) { return $('#registration_email').val() != password } + + // window.checkTop100 = function(password) { + // if (!window.top100) { + // getTop100().then(function() { + // return !window.top100.includes(password) + // }) + // } else { + // return !window.top100.includes(password) + // } + // + // } + + // function getTop100() { + // return $.ajax({ + // url: 'https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/10_million_password_list_top_100.txt' + // }).then(function(data) { + // window.top100 = data + // }) + // } } }) diff --git a/app/views/passwords/edit.html.erb b/app/views/passwords/edit.html.erb index f4c901d..aee5768 100644 --- a/app/views/passwords/edit.html.erb +++ b/app/views/passwords/edit.html.erb @@ -14,7 +14,7 @@
- <%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength,checkTop100" } %> + <%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength" } %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 7dcbfcc..6ecdf93 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -39,12 +39,12 @@

We know password rules are annoying, but there are some easy ways to ensure your account remains secure. For more info on why we use these password constraints, check out <%= link_to 'Password Rules Are Bullshit', 'https://blog.codinghorror.com/password-rules-are-bullshit/', target: '_blank' %> on the Coding Horror blog.

  1. Minimum length of 10 characters
  2. -
  3. Isn't in the <%= link_to 'top 100', 'https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/10_million_password_list_top_100.txt'%> most common passwords
  4. +
  5. Doesn't match your email
- <%= f.password_field :password, data: { rules: "checkLength,checkTop100,ensureDoesntMatchEmail" } %> + <%= f.password_field :password, data: { rules: "checkLength,ensureDoesntMatchEmail" } %>