mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Fixes error on missing reset_password_sent_at column.
If the column is not present, you are unabled to reset your password.
This commit is contained in:
committed by
José Valim
parent
79c100008a
commit
fdfe6a8340
@@ -42,6 +42,7 @@ module Devise
|
||||
# Checks if the reset password token sent is within the limit time.
|
||||
# We do this by calculating if the difference between today and the
|
||||
# sending date does not exceed the confirm in time configured.
|
||||
# Returns true if the ressource is not responding to reset_password_sent_at at all.
|
||||
# reset_password_within is a model configuration, must always be an integer value.
|
||||
#
|
||||
# Example:
|
||||
@@ -59,7 +60,8 @@ module Devise
|
||||
# reset_password_period_valid? # will always return false
|
||||
#
|
||||
def reset_password_period_valid?
|
||||
respond_to?(:reset_password_sent_at) && reset_password_sent_at &&
|
||||
return true unless respond_to?(:reset_password_sent_at)
|
||||
reset_password_sent_at &&
|
||||
reset_password_sent_at.utc >= self.class.reset_password_within.ago
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user