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

Commit

Permalink
Small bug fixes and improvements (#117)
Browse files Browse the repository at this point in the history
* Highlight text in estimate block on click. (#112)

* Properly skip password validation. (#114)

* Use Latin subset for fonts to improve rendering speed. (#115)

* Add field to use ShowPassword. (#116)
  • Loading branch information
Garrett Martin authored Feb 25, 2018
1 parent 725d7bc commit ddef4e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@ def average_rating(from:, to:)
end

def forgot_password!
update(
self.skip_password_validation = true

update!(
password_reset_token: SecureRandom.hex,
password_reset_token_expiration: Time.current + 2.hours
)
end

def eligible_for_password_reset
return false unless password_reset_token_expiration.present?

password_reset_token_expiration > Time.current
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="ROBOTS" content="NOODP" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link href="https://fonts.googleapis.com/css?family=Karla:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Karla:400,700&subset=latin" rel="stylesheet">
<%= favicon_link_tag 'favicon' %>
<link rel="apple-touch-icon" sizes="152x152" href="/assets/apple-icon.png" />
<%#
Expand Down
4 changes: 3 additions & 1 deletion app/views/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<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>
</ol>
</div>
<%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength,checkTop100" } %>
<div id="showHidePassword">
<%= password_field_tag :password, nil, id: "reset_password", data: { rules: "checkLength,checkTop100" } %>
</div>
</div>

<div class="inputGroup flexRow flexAlignCenter">
Expand Down

0 comments on commit ddef4e1

Please sign in to comment.