mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
12 lines
630 B
Ruby
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
|