Module: TCellAgent::DoorkeeperInstrumentation::TCellAuthorizationsNew

Defined in:
lib/tcell_agent/rails/auth/doorkeeper.rb

Instance Method Summary collapse

Instance Method Details

#newObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/tcell_agent/rails/auth/doorkeeper.rb', line 45

def new
  super if defined?(super)

  TCellAgent::Instrumentation.safe_block('Doorkeeper Token Authorize') do
    return unless TCellAgent.configuration.should_intercept_requests?
    return unless pre_auth.error

     = TCellAgent.policy(TCellAgent::PolicyTypes::LOGINFRAUD)
    tcell_data = request.env[TCellAgent::Instrumentation::TCELL_ID]

    return unless tcell_data

    user_id = current_resource_owner.id
    password = nil
    headers = request.env
    user_valid = nil
    .(
      user_id,
      password,
      headers,
      user_valid,
      tcell_data
    )
  end
end