Class: Doorkeeper::OAuth::Authorization::Code
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::Authorization::Code
- Defined in:
- lib/doorkeeper/oauth/authorization/code.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.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #access_grant? ⇒ Boolean
-
#initialize(pre_auth, resource_owner) ⇒ Code
constructor
A new instance of Code.
- #issue_token! ⇒ Object
- #oob_redirect ⇒ Object
Constructor Details
#initialize(pre_auth, resource_owner) ⇒ Code
Returns a new instance of Code.
9 10 11 12 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 9 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.
7 8 9 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 7 def pre_auth @pre_auth end |
#resource_owner ⇒ Object (readonly)
Returns the value of attribute resource_owner.
7 8 9 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 7 def resource_owner @resource_owner end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
7 8 9 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 7 def token @token end |
Instance Method Details
#access_grant? ⇒ Boolean
24 25 26 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 24 def access_grant? true end |
#issue_token! ⇒ Object
14 15 16 17 18 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 14 def issue_token! return @token if defined?(@token) @token = Doorkeeper.config.access_grant_model.create!(access_grant_attributes) end |
#oob_redirect ⇒ Object
20 21 22 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 20 def oob_redirect { action: :show, code: token.plaintext_token } end |