Sha256: b56ef324bffa5c9344ea067a9b4eb028c1918643c3667633c208d62fa21dbf89

Contents?: true

Size: 459 Bytes

Versions: 7

Compression:

Stored size: 459 Bytes

Contents

module Trestle
  module Auth
    module ModelMethods
      extend ActiveSupport::Concern
      extend ActiveSupport::Autoload

      autoload :Rememberable

      included do
        has_secure_password
      end

      module ClassMethods
        def authenticate(identifier, password)
          user = find_by(Trestle.config.auth.authenticate_with => identifier) || NullUser.new
          user.authenticate(password)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trestle-auth-0.3.0 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.5 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.4 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.3 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.2 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.1 lib/trestle/auth/model_methods.rb
trestle-auth-0.2.0 lib/trestle/auth/model_methods.rb