Skip to content

Commit 0c078ca

Browse files
committed
feat!: update auth ctor signature
1 parent ea7d56e commit 0c078ca

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

lib/passageidentity/auth.rb

+3-12
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,13 @@
88
module Passage
99
# The Passage::Auth class provides methods for authenticating requests and tokens
1010
class Auth
11-
def initialize(app_id, api_key, auth_strategy)
12-
@app_cache = ActiveSupport::Cache::MemoryStore.new
11+
def initialize(app_id:, req_opts:)
1312
@app_id = app_id
14-
@api_key = api_key
15-
@auth_strategy = auth_strategy
13+
@req_opts = req_opts
1614

15+
@app_cache = ActiveSupport::Cache::MemoryStore.new
1716
fetch_jwks
1817

19-
header_params = { 'Passage-Version' => "passage-ruby #{Passage::VERSION}" }
20-
header_params['Authorization'] = "Bearer #{@api_key}" if @api_key != ''
21-
22-
@req_opts = {}
23-
@req_opts[:header_params] = header_params
24-
@req_opts[:debug_auth_names] = ['header']
25-
26-
@tokens_client = OpenapiClient::TokensApi.new
2718
@magic_links_client = OpenapiClient::MagicLinksApi.new
2819
end
2920

lib/passageidentity/client.rb

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
require_relative 'version'
66

77
module Passage
8-
COOKIE_STRATEGY = 0
9-
HEADER_STRATEGY = 1
10-
118
EMAIL_CHANNEL = 'email'
129
PHONE_CHANNEL = 'phone'
1310

0 commit comments

Comments
 (0)