Sha256: f5341fbac49f42c919a624e994ee1382d5bf6a93a234191187ae2ee53a329dc1

Contents?: true

Size: 740 Bytes

Versions: 18

Compression:

Stored size: 740 Bytes

Contents

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

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

      def authorize
        @response = if pre_auth.authorizable?
          auth = Authorization::Code.new(pre_auth, resource_owner)
          auth.issue_token
          CodeResponse.new pre_auth, auth
        else
          ErrorResponse.from_request pre_auth
        end
      end

      def deny
        pre_auth.error = :access_denied
        ErrorResponse.from_request(pre_auth, :redirect_uri => pre_auth.redirect_uri)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
doorkeeper-1.1.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-1.0.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-1.0.0.rc2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-1.0.0.rc1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.7.4 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.7.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.7.2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.7.1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.7.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.7 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.6 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.5 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.4 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.3 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.2 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.1 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.0 lib/doorkeeper/oauth/code_request.rb
doorkeeper-0.6.0.rc1 lib/doorkeeper/oauth/code_request.rb