Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Commit

Permalink
Remove top 100 passwords check due to deprecated link (#121) (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshamurthy authored Mar 16, 2018
1 parent ddef4e1 commit 5f5aaf4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions app/assets/javascripts/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
// })
// }
}
})
2 changes: 1 addition & 1 deletion app/views/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ol>
</div>
<div id="showHidePassword">
<%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength,checkTop100" } %>
<%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength" } %>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<p>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.</p>
<ol>
<li>Minimum length of 10 characters <span class="xMark"></span></li>
<li>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 <span class="xMark"></span></li>
<!-- <li>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 <span class="xMark"></span></li> -->
<li>Doesn't match your email <span class="xMark"></span></li>
</ol>
</div>
<div id="showHidePassword">
<%= f.password_field :password, data: { rules: "checkLength,checkTop100,ensureDoesntMatchEmail" } %>
<%= f.password_field :password, data: { rules: "checkLength,ensureDoesntMatchEmail" } %>
</div>
</div>

Expand Down

0 comments on commit 5f5aaf4

Please sign in to comment.