2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2023-05-19 14:29:47 +00:00
|
|
|
|
|
|
|
|
class Auth::Error::TwoFactorRequired < Auth::Error::Base
|
2023-05-31 09:54:14 +00:00
|
|
|
attr_reader :default_two_factor_authentication_method, :available_two_factor_authentication_methods, :recovery_codes_available
|
2023-05-19 14:29:47 +00:00
|
|
|
|
|
|
|
|
def initialize(auth_user)
|
2023-05-31 09:54:14 +00:00
|
|
|
@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?
|
2023-05-19 14:29:47 +00:00
|
|
|
super()
|
|
|
|
|
end
|
|
|
|
|
end
|