Class: Doorkeeper::OAuth::CodeRequest
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::CodeRequest
- Defined in:
- lib/doorkeeper/oauth/code_request.rb
Instance Attribute Summary collapse
-
#pre_auth ⇒ Object
readonly
Returns the value of attribute pre_auth.
-
#resource_owner ⇒ Object
readonly
Returns the value of attribute resource_owner.
Instance Method Summary collapse
- #authorize ⇒ Object
- #deny ⇒ Object
-
#initialize(pre_auth, resource_owner) ⇒ CodeRequest
constructor
A new instance of CodeRequest.
Constructor Details
#initialize(pre_auth, resource_owner) ⇒ CodeRequest
Returns a new instance of CodeRequest.
8 9 10 11 |
# File 'lib/doorkeeper/oauth/code_request.rb', line 8 def initialize(pre_auth, resource_owner) @pre_auth = pre_auth @resource_owner = resource_owner end |
Instance Attribute Details
#pre_auth ⇒ Object (readonly)
Returns the value of attribute pre_auth.
6 7 8 |
# File 'lib/doorkeeper/oauth/code_request.rb', line 6 def pre_auth @pre_auth end |
#resource_owner ⇒ Object (readonly)
Returns the value of attribute resource_owner.
6 7 8 |
# File 'lib/doorkeeper/oauth/code_request.rb', line 6 def resource_owner @resource_owner end |
Instance Method Details
#authorize ⇒ Object
13 14 15 16 17 |
# File 'lib/doorkeeper/oauth/code_request.rb', line 13 def auth = Authorization::Code.new(pre_auth, resource_owner) auth.issue_token! CodeResponse.new(pre_auth, auth, response_on_fragment: pre_auth.response_mode == "fragment") end |
#deny ⇒ Object
19 20 21 22 |
# File 'lib/doorkeeper/oauth/code_request.rb', line 19 def deny pre_auth.error = Errors::AccessDenied pre_auth.error_response end |