You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if it were possible to add some conditions, under which the 2FA is not required upon login. For example if the request were to come from a trusted IP .
A possible solution could be something like this --> Add this to your login-controller
def bypass_two_factor_authentication(request)
request.ip != '127.0.0.1'
end
Extend the lib/devise_two_factor/strategies/two_factor_authenticatable.rb
def validate_otp(resource)
return true unless resource.otp_required_for_login **_|| bypass_two_factor_authentication == true_**
return if params[scope]['otp_attempt'].nil?
resource.validate_and_consume_otp!(params[scope]['otp_attempt'])
end
The text was updated successfully, but these errors were encountered:
Feature request:
It would be great if it were possible to add some conditions, under which the 2FA is not required upon login. For example if the request were to come from a trusted IP .
A possible solution could be something like this --> Add this to your login-controller
Extend the lib/devise_two_factor/strategies/two_factor_authenticatable.rb
The text was updated successfully, but these errors were encountered: