class Doorkeeper::OAuth::ForbiddenTokenResponse

Public Class Methods

from_scopes(scopes, attributes = {}) click to toggle source
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 6
def self.from_scopes(scopes, attributes = {})
  new(attributes.merge(scopes: scopes))
end
new(attributes = {}) click to toggle source
Calls superclass method Doorkeeper::OAuth::ErrorResponse::new
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 10
def initialize(attributes = {})
  super(attributes.merge(name: :invalid_scope, state: :forbidden))
  @scopes = attributes[:scopes]
end

Public Instance Methods

description() click to toggle source
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 25
def description
  @description ||= I18n.t("doorkeeper.errors.messages.forbidden_token.missing_scope",
                          oauth_scopes: @scopes.map(&:to_s).join(" "),)
end
headers() click to toggle source
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 19
def headers
  headers = super
  headers.delete "WWW-Authenticate"
  headers
end
status() click to toggle source
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 15
def status
  :forbidden
end

Protected Instance Methods

exception_class() click to toggle source
# File lib/doorkeeper/oauth/forbidden_token_response.rb, line 32
def exception_class
  Doorkeeper::Errors::TokenForbidden
end