Sha256: 9bac795f41b980578d5f184821495d39ec781b48c04c891dcaeee00c87dcd2f2
Contents?: true
Size: 689 Bytes
Versions: 30
Compression:
Stored size: 689 Bytes
Contents
module Doorkeeper module OAuth class ForbiddenTokenResponse < ErrorResponse def self.from_scopes(scopes, attributes = {}) new(attributes.merge(scopes: scopes)) end def initialize(attributes = {}) super(attributes.merge(name: :invalid_scope, state: :forbidden)) @scopes = attributes[:scopes] end def status :forbidden end def headers headers = super headers.delete 'WWW-Authenticate' headers end def description scope = { scope: [:doorkeeper, :scopes] } @description ||= @scopes.map { |r| I18n.translate r, scope }.join('\n') end end end end
Version data entries
30 entries across 30 versions & 1 rubygems