Sha256: da7b888556bbd8ab4034cf8cec3aef8c4c4b8b743a41a87472db3982e772caf0

Contents?: true

Size: 606 Bytes

Versions: 12

Compression:

Stored size: 606 Bytes

Contents

require 'devise/strategies/doorkeeper'

module Devise
  module Doorkeeper
    module DoorkeeperFailureApp
      def respond
        if oauth_error?
          invalid_oauth_token
        else
          super
        end
      end

      private

      def oauth_error?
        warden_message == Devise::Strategies::Doorkeeper::WARDEN_INVALID_TOKEN_MESSAGE
      end

      def invalid_oauth_token
        error = ::Doorkeeper::OAuth::InvalidTokenResponse.new
        headers.merge! error.headers
        self.response_body = error.body.to_json
        self.status = error.status
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
devise-doorkeeper-1.1.2.ci.123.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.118.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.112.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.103.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.96.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.89.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.62.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.59.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.45.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.33.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2.ci.30.1 lib/devise/doorkeeper/doorkeeper_failure_app.rb
devise-doorkeeper-1.1.2 lib/devise/doorkeeper/doorkeeper_failure_app.rb