1 # frozen_string_literal: true
4 require 'devise/strategies/base'
8 class TwoFactorLdapAuthenticatable
< Base
10 valid_params
? && mapping
.to
.respond_to
?(:authenticate_with_ldap)
14 resource
= mapping
.to
.authenticate_with_ldap(params
[scope
])
16 if resource
&& !resource
.otp_required_for_login
?
26 params
[scope
] && params
[scope
][:password].present
?
32 Warden
::Strategies.add(:two_factor_ldap_authenticatable, Devise
::Strategies::TwoFactorLdapAuthenticatable)