Sha256: a80366cece15e7e9bf308329726399a38fbed62f5981b3c5c1ea129fe587ce47

Contents?: true

Size: 799 Bytes

Versions: 18

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module OAuth
    class TokenResponse
      attr_reader :token

      def initialize(token)
        @token = token
      end

      def body
        {
          "access_token" => token.plaintext_token,
          "token_type" => token.token_type,
          "expires_in" => token.expires_in_seconds,
          "refresh_token" => token.plaintext_refresh_token,
          "scope" => token.scopes_string,
          "created_at" => token.created_at.to_i,
        }.reject { |_, value| value.blank? }
      end

      def status
        :ok
      end

      def headers
        {
          "Cache-Control" => "no-store",
          "Pragma" => "no-cache",
          "Content-Type" => "application/json; charset=utf-8",
        }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
doorkeeper-5.6.5 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.4 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.3 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.2 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.1 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.0 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.4 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.3 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.2 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.1 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.0 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.0.rc2 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.5.0.rc1 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.4.0 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.4.0.rc2 lib/doorkeeper/oauth/token_response.rb
doorkeeper-5.4.0.rc1 lib/doorkeeper/oauth/token_response.rb