summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-02 14:37:07 +0000
committerDouwe Maan <douwe@gitlab.com>2015-10-02 14:37:07 +0000
commit93522e59eccd8fd5801f313b34fec6a4f6394d9a (patch)
treebb7bceb68b7b0159ddf6926f240ace561bb13062 /app/models/user.rb
parentc867c225095319684ad6ff396e4194bb1b5920d5 (diff)
parentd40dd5cfe331c5e465b77c8eecae9697c873a67a (diff)
downloadgitlab-ce-93522e59eccd8fd5801f313b34fec6a4f6394d9a.tar.gz
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/user.rb')
-rw-r--r--app/models/user.rb4
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,