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

Remove top 100 passwords check due to deprecated link #121

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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