class Doorkeeper::OAuth::Authorization::Code

Attributes

pre_auth[RW]
resource_owner[RW]
token[RW]

Public Class Methods

new(pre_auth, resource_owner) click to toggle source
# File lib/doorkeeper/oauth/authorization/code.rb, line 7
def initialize(pre_auth, resource_owner)
  @pre_auth       = pre_auth
  @resource_owner = resource_owner
end

Public Instance Methods

configuration() click to toggle source
# File lib/doorkeeper/oauth/authorization/code.rb, line 26
def configuration
  Doorkeeper.configuration
end
issue_token() click to toggle source
# File lib/doorkeeper/oauth/authorization/code.rb, line 12
def issue_token
  @token ||= AccessGrant.create!(
    application_id: pre_auth.client.id,
    resource_owner_id: resource_owner.id,
    expires_in: configuration.authorization_code_expires_in,
    redirect_uri: pre_auth.redirect_uri,
    scopes: pre_auth.scopes.to_s
  )
end
native_redirect() click to toggle source
# File lib/doorkeeper/oauth/authorization/code.rb, line 22
def native_redirect
  { action: :show, code: token.token }
end