Class: SpreeCmCommissioner::UserCrossAppHandoffAuthenticator

Inherits:
BaseInteractor
  • Object
show all
Defined in:
app/interactors/spree_cm_commissioner/user_cross_app_handoff_authenticator.rb

Instance Method Summary collapse

Instance Method Details

#call ⇒ Object



9
10
11
12
13
14
15
# File 'app/interactors/spree_cm_commissioner/user_cross_app_handoff_authenticator.rb', line 9

def call
  result = SpreeCmCommissioner::CrossAppHandoffTokens::Decode.call(token: handoff_token, purpose: 'operator_sign_in')
  context.fail!(message: I18n.t('authenticator.incorrect_login')) unless result.success?

  context.user = result.value[:user]
  reject_unauthenticatable_user!(context.user)
end