Class: WorkOS::RefreshAuthenticationResponse

Inherits:
Object
  • Object
show all
Includes:
HashProvider
Defined in:
lib/workos/refresh_authentication_response.rb

Overview

The RefreshAuthenticationResponse contains response data from a successful UserManagement.authenticate_with_refresh_token call

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashProvider

#to_h

Constructor Details

#initialize(authentication_response_json) ⇒ RefreshAuthenticationResponse

Returns a new instance of RefreshAuthenticationResponse.



11
12
13
14
15
# File 'lib/workos/refresh_authentication_response.rb', line 11

def initialize(authentication_response_json)
  json = JSON.parse(authentication_response_json, symbolize_names: true)
  @access_token = json[:access_token]
  @refresh_token = json[:refresh_token]
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



9
10
11
# File 'lib/workos/refresh_authentication_response.rb', line 9

def access_token
  @access_token
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



9
10
11
# File 'lib/workos/refresh_authentication_response.rb', line 9

def refresh_token
  @refresh_token
end

Instance Method Details

#to_jsonObject



17
18
19
20
21
22
# File 'lib/workos/refresh_authentication_response.rb', line 17

def to_json(*)
  {
    access_token: access_token,
    refresh_token: refresh_token,
  }
end