我目前正在开发带有设计身份验证的 Rails 应用程序。我需要禁用令牌过期以重置密码。根据有关可恢复的设计文档,没有配置可以做到这一点。我认为使它起作用的唯一方法是覆盖 Recoverable 和reset_password_period_valid?
始终返回 true 的函数。但我不确定是否是最佳/正确的解决方案。
当前在我的 devise.rb 我有:
# ==> Configuration for :recoverable
#
# Defines which key will be used when recovering the password for an account
# config.reset_password_keys = [ :email ]
# Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to
# change their passwords.
config.reset_password_within = 2.hours