Class: PasskeysRails::RefreshToken

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
app/interactors/passkeys_rails/refresh_token.rb

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
# File 'app/interactors/passkeys_rails/refresh_token.rb', line 8

def call
  agent = ValidateAuthToken.call!(auth_token: token).agent

  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