1 # frozen_string_literal: true
3 require 'devise/strategies/base'
7 class TwoFactorPamAuthenticatable
< Base
9 valid_params
? && mapping
.to
.respond_to
?(:authenticate_with_pam)
13 resource
= mapping
.to
.authenticate_with_pam(params
[scope
])
15 if resource
&& !resource
.otp_required_for_login
?
25 params
[scope
] && params
[scope
][:password].present
?
31 Warden
::Strategies.add(:two_factor_pam_authenticatable, Devise
::Strategies::TwoFactorPamAuthenticatable)