app/models/users/authentication.rb
# Override Authlogic's validate_by_password() to allow blank passwords. See
# authlogic/lib/authlogic/session/password.rb for details.
#----------------------------------------------------------------------------
Override Authlogic's validate_by_password() to allow blank passwords.
Override Authlogic ' s validate_by_password () to allow blank passwords .
def validate_by_password
    self.invalid_password = false
    self.attempted_record = search_for_record(find_by_login_method, send(login_field))
    if attempted_record.blank?
      generalize_credentials_error_messages? ?
        add_general_credentials_error :
        errors.add(login_field, I18n.t('error_messages.login_not_found', :default => "is not valid"))
      return
    end
    if !attempted_record.send(verify_password_method, send("protected_#{password_field}"))
      self.invalid_password = true
      generalize_credentials_error_messages? ?
        add_general_credentials_error :
        errors.add(password_field, I18n.t('error_messages.password_invalid', :default => "is not valid"))
      return
    end
  end
def validate_by_password self . invalid_password = false self . attempted_record = search_for_record ( find_by_login_method , send ( login_field ) ) if attempted_record . blank? generalize_credentials_error_messages? ? add_general_credentials_error : errors . add ( login_field , I18n . t ( 'error_messages.login_not_found' , :default => "is not valid" ) ) return end if ! attempted_record . send ( verify_password_method , send ( "protected_#{password_field}" ) ) self . invalid_password = true generalize_credentials_error_messages? ? add_general_credentials_error : errors . add ( password_field , I18n . t ( 'error_messages.password_invalid' , :default => "is not valid" ) ) return end end
Override Authlogic's validate_by_password() to allow blank passwords.
Override Authlogic ' s validate_by_password () to allow blank passwords .