diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-02 17:37:07 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-02 17:37:07 +0300 |
commit | 93522e59eccd8fd5801f313b34fec6a4f6394d9a (patch) | |
tree | bb7bceb68b7b0159ddf6926f240ace561bb13062 /app/models | |
parent | c867c225095319684ad6ff396e4194bb1b5920d5 (diff) | |
parent | d40dd5cfe331c5e465b77c8eecae9697c873a67a (diff) |
Merge branch 'rs-throttle-reset' into 'master'
Throttle "Forgot your password?" emails
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2611
See merge request !1476
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 9ea7cabff15..d627b591370 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -328,6 +328,10 @@ class User < ActiveRecord::Base @reset_token end + def recently_sent_password_reset? + reset_password_sent_at.present? && reset_password_sent_at >= 1.minute.ago + end + def disable_two_factor! update_attributes( two_factor_enabled: false, |