open_api_smart_recruiters_sdk 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 197237df4710349560b7e02b19d57d4330e94552eec9a8e7db7860d5793a8421
4
- data.tar.gz: fdbd5b5566cd8609d0993db1c04c2e591cfc8e6e8b7fe69b7f8a2042acc83c4c
3
+ metadata.gz: 439f69e8d60e69b97fe4653a60036b44ed682a19c91db7483c447ef7530dfdbd
4
+ data.tar.gz: 3de01e25124ed31b652458fa548c73602f200f8479bd10fa93cfdaf97826ffda
5
5
  SHA512:
6
- metadata.gz: '08270e93a3ad6417f4014a3ad1eed26b6c72361271c01d3eb08daf80082fb0b6c2e67cb028632553de462825439eb1637de1e92fd8d2ef9f435ca390b59158df'
7
- data.tar.gz: ce7ac54668aa5b6a9c8d9b36fd7548eebaaed960e898cd2cabe9351262eb1c00fe43313ddd9f3fbcd5a2d611ebe87cd9f1ff42ac318ccaa511357237d4e60f5a
6
+ metadata.gz: 6599f826b2a0e1b5e400cab4cace8aa24e6cc055a2c24d977d7b399f1a56db22f4623b3291f53cf2aff6e672bdf918783cef1958c533041dd70d605593947c19
7
+ data.tar.gz: 8766458b663269de4ff7f8b4a85487346b2d2d332f748067dbd7dd227fd78549a3482342b96c40a113a8a1359948e25196c639dacfd611e1a30a3d2b647239cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_api_smart_recruiters_sdk (0.2.2)
4
+ open_api_smart_recruiters_sdk (0.2.3)
5
5
  oauth2 (~> 2.0)
6
6
  typhoeus (~> 1.4)
7
7
 
@@ -17,9 +17,8 @@ module SmartRecruiters
17
17
 
18
18
  # Initializes the ApiClient
19
19
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
20
- def initialize(access_token, config = Configuration.default)
20
+ def initialize(config = Configuration.default)
21
21
  @config = config
22
- @config.access_token = access_token
23
22
  @user_agent = "SmartRecruiters/#{VERSION}/ruby"
24
23
  @default_headers = {
25
24
  'Content-Type' => 'application/json',
@@ -26,7 +26,7 @@ module SmartRecruiters
26
26
  end
27
27
 
28
28
  def build_authorize_url
29
- authorize_url = client.auth_code.authorize_url
29
+ authorize_url = oauth_client.auth_code.authorize_url
30
30
 
31
31
  unless @config.scopes.length.zero?
32
32
  authorize_url += "&scope=" + @config.scopes.join("%20")
@@ -53,9 +53,19 @@ module SmartRecruiters
53
53
  }
54
54
  )
55
55
 
56
- token.refresh!({ client_id: config.client_id, client_secret: config.client_secret }) if token.expired?
56
+ if token.expired?
57
+ token.refresh!({ client_id: config.client_id, client_secret: config.client_secret })
58
+
59
+ load_token(token)
60
+ end
57
61
 
58
62
  token
59
63
  end
64
+
65
+ def load_token(token)
66
+ SmartRecruiters::Configuration.default.access_token = token.token
67
+ SmartRecruiters::Configuration.default.token_expires_at = token.expires_at
68
+ SmartRecruiters::Configuration.default.refresh_token = token.refresh_token
69
+ end
60
70
  end
61
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartRecruiters
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_api_smart_recruiters_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneNeptune
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2