Class: Drillbit::Responses::InvalidToken

Inherits:
Object
  • Object
show all
Defined in:
lib/drillbit/responses/invalid_token.rb

Class Method Summary collapse

Class Method Details

.call(_env, application_name:) ⇒ Object

rubocop:disable Style/InlineComment



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/drillbit/responses/invalid_token.rb', line 9

def self.call(_env, application_name:)
  error = Drillbit::Errors::InvalidToken.new

  [
    error.http_status,                    # HTTP Status Code
    {                                     # Response Headers
      'WWW-Authenticate' => %Q{Token realm="#{application_name}"},
    },
    ["{\"errors\": [#{error.to_json}]}"], # Message
  ]
end