Skip to content

Commit 90c5c3f

Browse files
committed
feat!: remove deprecated Client methods
1 parent 4016022 commit 90c5c3f

File tree

2 files changed

+0
-97
lines changed

2 files changed

+0
-97
lines changed

lib/passageidentity/client.rb

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# frozen_string_literal: true
22

3-
require 'rubygems'
43
require_relative 'auth'
54
require_relative 'user_api'
65
require_relative 'error'
76
require_relative 'version'
8-
require_relative '../openapi_client'
97

108
module Passage
119
COOKIE_STRATEGY = 0
@@ -18,8 +16,6 @@ module Passage
1816
class Client
1917
attr_reader :auth, :user
2018

21-
extend Gem::Deprecate
22-
2319
def initialize(app_id:, api_key: '', auth_strategy: COOKIE_STRATEGY)
2420
@app_id = app_id
2521
@api_key = api_key
@@ -44,70 +40,8 @@ def initialize(app_id:, api_key: '', auth_strategy: COOKIE_STRATEGY)
4440
@req_opts[:header_params] = header_params
4541
@req_opts[:debug_auth_names] = ['header']
4642

47-
# initialize auth class
4843
@auth = Passage::Auth.new(@app_id, @api_key, @auth_strategy)
49-
50-
# initialize user class
5144
@user = Passage::UserAPI.new(@app_id, @api_key)
52-
53-
@magic_links_client = OpenapiClient::MagicLinksApi.new
54-
end
55-
56-
# rubocop:disable Naming/AccessorMethodName
57-
def get_app
58-
client = OpenapiClient::AppsApi.new
59-
client.get_app(@app_id).app
60-
rescue StandardError => e
61-
raise e
62-
end
63-
# rubocop:enable Naming/AccessorMethodName
64-
65-
# rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
66-
def create_magic_link(
67-
user_id: '',
68-
email: '',
69-
phone: '',
70-
channel: '',
71-
send: false,
72-
magic_link_path: '',
73-
redirect_url: '',
74-
language: '',
75-
ttl: 60,
76-
type: 'login'
77-
)
78-
args = {}
79-
args['user_id'] = user_id unless user_id.empty?
80-
args['email'] = email unless email.empty?
81-
args['phone'] = phone unless phone.empty?
82-
83-
unless [PHONE_CHANNEL, EMAIL_CHANNEL].include? channel
84-
raise PassageError.new(
85-
message:
86-
'channel: must be either Passage::EMAIL_CHANNEL or Passage::PHONE_CHANNEL'
87-
)
88-
end
89-
90-
args['channel'] = channel unless channel.empty?
91-
args['type'] = type
92-
args['send'] = send
93-
94-
args['language'] = language unless language.empty?
95-
args['magic_link_path'] = magic_link_path unless magic_link_path.empty?
96-
args['redirect_url'] = redirect_url unless redirect_url.empty?
97-
args['ttl'] = ttl unless ttl.zero?
98-
99-
begin
100-
@magic_links_client.create_magic_link(@app_id, args, @req_opts).magic_link
101-
rescue Faraday::Error => e
102-
raise PassageError.new(
103-
status_code: e.response[:status],
104-
body: e.response[:body]
105-
)
106-
end
10745
end
108-
# rubocop:enable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
109-
110-
deprecate(:create_magic_link, 'Passage::Auth.create_magic_link', 2025, 1)
111-
deprecate(:get_app, :none, 2025, 1)
11246
end
11347
end

tests/app_test.rb

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)