Module: Devise::Models::PamAuthenticatable

Defined in:
lib/devise_pam_authenticatable/model.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/devise_pam_authenticatable/model.rb', line 7

def self.included(base)
  base.class_eval do
    extend ClassMethods

    attr_accessor :password
  end
end

Instance Method Details

#clean_up_passwordsObject

Set password to nil



16
17
18
# File 'lib/devise_pam_authenticatable/model.rb', line 16

def clean_up_passwords
  self.password = nil
end

#valid_pam_authentication?(password) ⇒ Boolean

Checks if a resource is valid upon authentication.

Returns:

  • (Boolean)


21
22
23
# File 'lib/devise_pam_authenticatable/model.rb', line 21

def valid_pam_authentication?(password)
  Devise::PamAdapter.valid_credentials?(self.username, password)
end