mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
Co-authored-by: Benjamin Scharf <bs@zammad.com> Co-authored-by: Dominik Klein <dk@zammad.com> Co-authored-by: Dusan Vuckovic <dv@zammad.com> Co-authored-by: Mantas Masalskis <mm@zammad.com> Co-authored-by: Martin Gruner <mg@zammad.com>
29 lines
773 B
Ruby
29 lines
773 B
Ruby
# Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
class Auth::TwoFactor::AuthenticationMethod < Auth::TwoFactor::Method
|
|
include Mixin::RequiredSubPaths
|
|
|
|
# Implement it in the real method itself if you need it.
|
|
# This needs to be used for e.g. sending out emails or SMS.
|
|
def initiate_authentication; end
|
|
|
|
def verify(payload, configuration = user_two_factor_preference_configuration)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def initiate_configuration
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def available?
|
|
true
|
|
end
|
|
|
|
def related_setting_name
|
|
"two_factor_authentication_method_#{method_name}"
|
|
end
|
|
|
|
def user_two_factor_preference
|
|
user&.two_factor_preferences&.authentication_methods&.find_by(method: method_name)
|
|
end
|
|
end
|