gpt4 book ai didi

ruby-on-rails - RoR 3.2 设计 (3.2.2) :timeoutable not working

转载 作者:行者123 更新时间:2023-12-04 05:35:50 26 4
gpt4 key购买 nike

在检查了几个问题后,例如:

rails 3.1, devise gem, :timeoutable is not working, why?

Devise - Timeout not working

devise config.timeout_in not working

How to configure time out using devise?

我已经用 :timeoutable 设置了我的用户模型

class User < ActiveRecord::Base
devise :rememberable, :demo_authenticatable, :api_authenticatable,:registerable,
:recoverable, :trackable, :validatable, :confirmable, :lockable, :timeoutable

而且我还取消了 devise.rb 文件中的 timeout_in 行的注释
config.timeout_in = 1.minutes

我还尝试在用户模型中设置 timeout_in 属性,但我一直保持登录状态

有什么线索吗?

提前致谢,干杯!

最佳答案

如果您希望它在刷新时向您显示登录页面,请从模型中删除超时部分并将其放入 devise.rb NOT development.rb 并重新启动 rails 服务器。config.timeout_in = 1.hour

关于ruby-on-rails - RoR 3.2 设计 (3.2.2) :timeoutable not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26757739/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com