Sha256: b64c43ed9f93c48786404f546d52b46259b8e21c1c88731c96db55d2a56d12c7

Contents?: true

Size: 545 Bytes

Versions: 12

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module OAuth
    class CodeRequest
      attr_accessor :pre_auth, :resource_owner

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

      def authorize
        auth = Authorization::Code.new(pre_auth, resource_owner)
        auth.issue_token
        CodeResponse.new(pre_auth, auth)
      end

      def deny
        pre_auth.error = :access_denied
        pre_auth.error_response
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
doorkeeper-5.2.6 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.3.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.5 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.3.2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.4 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.3.1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.3.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.2.0.rc3 lib/doorkeeper/oauth/code_request.rb