Module: APIGuard

Extended by:
ActiveSupport::Concern
Included in:
API, API::Open
Defined in:
app/api/concerns/api_guard.rb

Defined Under Namespace

Modules: ClassMethods, HelperMethods

Class Method Summary collapse

Class Method Details

.access_token_error_codesObject


160
161
162
163
164
165
# File 'app/api/concerns/api_guard.rb', line 160

def self.access_token_error_codes
  [
    [401, "Unauthorized: missing or bad access token."],
    [403, "Forbidden: the access token you hand over doesn't give the power you requested."]
  ]
end

.access_token_required_note(scope: nil) ⇒ Object


167
168
169
170
171
172
173
# File 'app/api/concerns/api_guard.rb', line 167

def self.access_token_required_note(scope: nil)
  if scope.present?
    "An access token with the #{scope} scope is required while making this request."
  else
    "An access token is required while making this request."
  end
end