更新时间:2023-12-04 09:52:04
将这两个方法添加到您的用户模型中,devise 应该自动选取它们 - 您不需要扩展 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