Class: OAuth2::TokenResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth20/token_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ TokenResponse

Returns a new instance of TokenResponse.



3
4
5
6
7
# File 'lib/oauth20/token_response.rb', line 3

def initialize(request)
  @access_token = AccessToken.new({:client_key => request.client.key, :user_id => request.user_id})
  @access_token.save
  request.code.invalidate(@access_token)
end

Instance Method Details

#to_jsonObject



9
10
11
# File 'lib/oauth20/token_response.rb', line 9

def to_json
  @access_token.to_json
end