Sha256: 0c33d6b46026ffe3181c7d1527db9a1eceeb9269d4ad35a238b5d665361aca80

Contents?: true

Size: 870 Bytes

Versions: 4

Compression:

Stored size: 870 Bytes

Contents

module Castronaut
  module Adapters
    module Development
      
      class User < ActiveRecord::Base
      
        def self.authenticate(username, password)
          if user = find_by_login(username)
            if user.password == password
              Castronaut::AuthenticationResult.new(username, nil)
            else
              Castronaut.config.logger.info "#{self} - Unable to authenticate username #{username} due to invalid authentication information"
              Castronaut::AuthenticationResult.new(username, "Unable to authenticate")
            end
          else
            Castronaut.config.logger.info "#{self} - Unable to authenticate username #{username} because it could not be found"
            Castronaut::AuthenticationResult.new(username, "Unable to authenticate")
          end
        end
        
      end
    
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
relevance-castronaut-0.7.4 lib/castronaut/adapters/development/user.rb
relevance-castronaut-0.7.5 lib/castronaut/adapters/development/user.rb
nbudin-castronaut-0.7.5 lib/castronaut/adapters/development/user.rb
factorylabs-castronaut-0.7.5 lib/castronaut/adapters/development/user.rb