I am using devise and created a User field called :active which is either true or false. I have to manually make the user active (true) before the user is allowed to log in. At least that is the intent. I have tried this...
class SessionsController < Devise::SessionsController
# POST /resource/sign_in
self.resource = warden.authenticate!(auth_options)
set_flash_message(:notice, :signed_in) if is_navigational_format?
respond_with resource, :location => after_sign_in_path_for(resource)
Add these two methods to your user model, devise should pick them up automatically - you should NOT need to extend
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