Module Authlogic::Session::Validation
In: lib/authlogic/session/validation.rb

Responsible for session validation

Methods

Classes and Modules

Class Authlogic::Session::Validation::Errors

Public Instance methods

You should use this as a place holder for any records that you find during validation. The main reason for this is to allow other modules to use it if needed. Take the failed_login_count feature, it needs this in order to increase the failed login count.

The errors in Authlogic work JUST LIKE ActiveRecord. In fact, it uses the exact same ActiveRecord errors class. Use it the same way:

Example

 class UserSession
   before_validation :check_if_awesome

   private
     def check_if_awesome
       errors.add(:login, "must contain awesome") if login && !login.include?("awesome")
       errors.add(:base, "You must be awesome to log in") unless attempted_record.awesome?
     end
 end

Determines if the information you provided for authentication is valid or not. If there is a problem with the information provided errors will be added to the errors object and this method will return false.

[Validate]