class Doorkeeper::OAuth::Authorization::Code

def configuration

def configuration
  Doorkeeper.configuration
end

def initialize(pre_auth, resource_owner)

def initialize(pre_auth, resource_owner)
  @pre_auth       = pre_auth
  @resource_owner = resource_owner
end

def issue_token

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

def native_redirect

def native_redirect
  { action: :show, code: token.token }
end