Sha256: c3622d25ab2fced074031954b2fcf72b1a75fd0fa3869bf2a148597e63e93294

Contents?: true

Size: 598 Bytes

Versions: 13

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module OAuth
    class CodeRequest
      attr_reader :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, response_on_fragment: pre_auth.response_mode == "fragment")
      end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
doorkeeper-5.6.7 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.6 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.5 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.4 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.5.4 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.5.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-5.5.2 lib/doorkeeper/oauth/code_request.rb