summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorGuilherme Garnier <guilherme.garnier@gmail.com>2015-10-03 11:46:29 -0500
committerGuilherme Garnier <guilherme.garnier@gmail.com>2015-10-03 11:46:29 -0500
commit1cfb48ddd005f599a453dcd9a4471fb003e6c222 (patch)
tree28037a6ffa676455ad64bdc3450d7d5099244a6c /app/models/user.rb
parent848d7b2a2be28982d0f164d4e3a966c300e7c322 (diff)
parent662f8af497656754c7ad27c0250d2aae825b8545 (diff)
downloadgitlab-ce-1cfb48ddd005f599a453dcd9a4471fb003e6c222.tar.gz
Merge remote-tracking branch 'upstream/master'
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 ef687f737cc..1069f8e3664 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,