Class: PasskeysRails::DebugRegister

Inherits:
Object
  • Object
show all
Includes:
Interactor, AuthenticatableCreator, Debuggable
Defined in:
app/interactors/passkeys_rails/debug_register.rb

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/interactors/passkeys_rails/debug_register.rb', line 13

def call
  ensure_debug_mode
  ensure_regex_match

  ActiveRecord::Base.transaction do
    create_authenticatable! if aux_class_name.present?
  end

  context.agent = agent
  context.username = agent.username
  context.auth_token = GenerateAuthToken.call!(agent:).auth_token
rescue Interactor::Failure => e
  context.fail! code: e.context.code, message: e.context.message
end