【发布时间】:2020-06-03 03:08:20
【问题描述】:
我目前正在开发带有设计身份验证的 Rails 应用程序。我需要禁用令牌过期以重置密码。根据Devise Documentation on Recoverable,没有配置可以做到这一点。我认为使它起作用的唯一方法是覆盖 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
【问题讨论】:
标签: ruby-on-rails ruby devise devise-recoverable