class Doorkeeper::OAuth::TokenResponse

Attributes

issued_token[R]
token[R]

Public Class Methods

new(token) click to toggle source
# File lib/doorkeeper/oauth/token_response.rb, line 10
def initialize(token)
  @token = token
end

Public Instance Methods

body() click to toggle source
# File lib/doorkeeper/oauth/token_response.rb, line 14
def body
  @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
headers() click to toggle source
# File lib/doorkeeper/oauth/token_response.rb, line 29
def headers
  {
    "Cache-Control" => "no-store, no-cache",
    "Content-Type" => "application/json; charset=utf-8",
    "Pragma" => "no-cache",
  }
end
status() click to toggle source
# File lib/doorkeeper/oauth/token_response.rb, line 25
def status
  :ok
end