Skip to content

Commit 5410bd9

Browse files
committed
feat!: update user ctor signature
1 parent 0c078ca commit 5410bd9

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lib/passageidentity/user_api.rb

+5-11
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@ module Passage
66
# The UserAPI class provides methods for interacting with Passage Users
77
class UserAPI
88
# rubocop:disable Metrics/AbcSize
9-
def initialize(app_id, api_key)
9+
def initialize(app_id:, req_opts:)
1010
@app_id = app_id
11-
@api_key = api_key
11+
@req_opts = req_opts
12+
1213
@user_client = OpenapiClient::UsersApi.new
1314
@user_device_client = OpenapiClient::UserDevicesApi.new
14-
15-
header_params = { 'Passage-Version' => "passage-ruby #{Passage::VERSION}" }
16-
header_params['Authorization'] = "Bearer #{@api_key}" if @api_key != ''
17-
18-
@req_opts = {}
19-
@req_opts[:header_params] = header_params
20-
@req_opts[:debug_auth_names] = ['header']
15+
@tokens_client = OpenapiClient::TokensApi.new
2116
end
2217

2318
def get(user_id:)
@@ -160,8 +155,7 @@ def revoke_refresh_tokens(user_id:)
160155
raise ArgumentError, 'user_id is required.' unless user_id && !user_id.empty?
161156

162157
begin
163-
tokens_client = OpenapiClient::TokensApi.new
164-
tokens_client.revoke_user_refresh_tokens(@app_id, user_id, @req_opts)
158+
@tokens_client.revoke_user_refresh_tokens(@app_id, user_id, @req_opts)
165159
rescue Faraday::Error => e
166160
raise PassageError.new(
167161
status_code: e.response[:status],

0 commit comments

Comments
 (0)