# File lib/devise/models/recoverable.rb, line 120 def reset_password_by_token(attributes={}) recoverable = find_or_initialize_with_error_by(:reset_password_token, attributes[:reset_password_token]) if recoverable.persisted? if recoverable.reset_password_period_valid? recoverable.reset_password!(attributes[:password], attributes[:password_confirmation]) else recoverable.errors.add(:reset_password_token, :expired) end end recoverable end