Class: Doorkeeper::OAuth::ForbiddenTokenResponse
Class Method Summary
collapse
Instance Method Summary
collapse
#authenticate_info, #body, from_request, #redirect_uri, #redirectable?
#build_query, #uri_with_fragment, #uri_with_query
Constructor Details
Returns a new instance of ForbiddenTokenResponse.
8
9
10
11
|
# File 'lib/doorkeeper/oauth/forbidden_token_response.rb', line 8
def initialize(attributes = {})
super(attributes.merge(name: :invalid_scope, state: :forbidden))
@scopes = attributes[:scopes]
end
|
Class Method Details
.from_scopes(scopes, attributes = {}) ⇒ Object
4
5
6
|
# File 'lib/doorkeeper/oauth/forbidden_token_response.rb', line 4
def self.from_scopes(scopes, attributes = {})
new(attributes.merge(scopes: scopes))
end
|
Instance Method Details
#description ⇒ Object
23
24
25
26
|
# File 'lib/doorkeeper/oauth/forbidden_token_response.rb', line 23
def description
scope = { scope: [:doorkeeper, :scopes] }
@description ||= @scopes.map { |r| I18n.translate r, scope }.join('\n')
end
|
17
18
19
20
21
|
# File 'lib/doorkeeper/oauth/forbidden_token_response.rb', line 17
def
= super
.delete 'WWW-Authenticate'
end
|
#status ⇒ Object
13
14
15
|
# File 'lib/doorkeeper/oauth/forbidden_token_response.rb', line 13
def status
:forbidden
end
|