更新时间:2023-09-28 21:12:58
将这两种方法添加到用户模型中,设计应自动接收它们 - 您不应该需要扩展 Devise :: SessionsController
Add these two methods to your user model, devise should pick them up automatically - you should NOT need to extend Devise::SessionsController
def active_for_authentication?
super && self.your_method_for_checking_active # i.e. super && self.is_active
end
def inactive_message
"Sorry, this account has been deactivated."
end