[英]Rails - Devise - Disable Reset Password Token expiration time
我目前正在开发具有设计身份验证的 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
例如,您可以将其设置为 10 年,就像禁用令牌过期一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.