Sha256: 1a9bef592f821bc4cae11f6664e7946b1c40154dd7a641696196cf5a5e710212

Contents?: true

Size: 452 Bytes

Versions: 13

Compression:

Stored size: 452 Bytes

Contents

require 'devise/strategies/base'


class Devise::Strategies::PamAuthenticatable < Devise::Strategies::Authenticatable
  def valid?
    super && (::Devise.emailfield || ::Devise.usernamefield)
  end

  def authenticate!
    if (resource = mapping.to.authenticate_with_pam(params[scope].clone))
      success!(resource)
    else
      fail(:invalid)
    end
  end
end

Warden::Strategies.add(:pam_authenticatable, Devise::Strategies::PamAuthenticatable)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
devise_pam_authenticatable2-9.1.1 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-9.1.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-9.0.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-8.0.2 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-8.0.1 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-8.0.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-7.0.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-6.1.1 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-6.1.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-6.0.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-5.0.1 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-5.0.0 lib/devise_pam_authenticatable/strategy.rb
devise_pam_authenticatable2-4.0.0 lib/devise_pam_authenticatable/strategy.rb