zammad/lib/auth/error/two_factor_required.rb
2026-01-02 15:41:09 +02:00

12 lines
630 B
Ruby

# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
class Auth::Error::TwoFactorRequired < Auth::Error::Base
attr_reader :default_two_factor_authentication_method, :available_two_factor_authentication_methods, :recovery_codes_available
def initialize(auth_user)
@default_two_factor_authentication_method = auth_user.two_factor.user_default_authentication_method.method_name
@available_two_factor_authentication_methods = auth_user.two_factor.user_authentication_methods.map(&:method_name)
@recovery_codes_available = auth_user.two_factor.user_recovery_codes_exists?
super()
end
end