@@ -170,8 +170,6 @@ public final class AuthClient: Sendable {
170
170
}
171
171
172
172
private func _signUp( request: HTTPRequest ) async throws -> AuthResponse {
173
- await sessionManager. remove ( )
174
-
175
173
let response = try await api. execute ( request) . decoded (
176
174
as: AuthResponse . self,
177
175
decoder: configuration. decoder
@@ -271,8 +269,6 @@ public final class AuthClient: Sendable {
271
269
}
272
270
273
271
private func _signIn( request: HTTPRequest ) async throws -> Session {
274
- await sessionManager. remove ( )
275
-
276
272
let session = try await api. execute ( request) . decoded (
277
273
as: Session . self,
278
274
decoder: configuration. decoder
@@ -302,8 +298,6 @@ public final class AuthClient: Sendable {
302
298
data: [ String : AnyJSON ] ? = nil ,
303
299
captchaToken: String ? = nil
304
300
) async throws {
305
- await sessionManager. remove ( )
306
-
307
301
let ( codeChallenge, codeChallengeMethod) = prepareForPKCE ( )
308
302
309
303
_ = try await api. execute (
@@ -348,7 +342,6 @@ public final class AuthClient: Sendable {
348
342
data: [ String : AnyJSON ] ? = nil ,
349
343
captchaToken: String ? = nil
350
344
) async throws {
351
- await sessionManager. remove ( )
352
345
_ = try await api. execute (
353
346
. init(
354
347
url: configuration. url. appendingPathComponent ( " otp " ) ,
@@ -378,8 +371,6 @@ public final class AuthClient: Sendable {
378
371
redirectTo: URL ? = nil ,
379
372
captchaToken: String ? = nil
380
373
) async throws -> SSOResponse {
381
- await sessionManager. remove ( )
382
-
383
374
let ( codeChallenge, codeChallengeMethod) = prepareForPKCE ( )
384
375
385
376
return try await api. execute (
@@ -413,8 +404,6 @@ public final class AuthClient: Sendable {
413
404
redirectTo: URL ? = nil ,
414
405
captchaToken: String ? = nil
415
406
) async throws -> SSOResponse {
416
- await sessionManager. remove ( )
417
-
418
407
let ( codeChallenge, codeChallengeMethod) = prepareForPKCE ( )
419
408
420
409
return try await api. execute (
@@ -834,8 +823,7 @@ public final class AuthClient: Sendable {
834
823
)
835
824
)
836
825
)
837
- ) ,
838
- shouldRemoveSession: type != . emailChange
826
+ )
839
827
)
840
828
}
841
829
@@ -861,19 +849,11 @@ public final class AuthClient: Sendable {
861
849
)
862
850
)
863
851
)
864
- ) ,
865
- shouldRemoveSession: type != . phoneChange
852
+ )
866
853
)
867
854
}
868
855
869
- private func _verifyOTP(
870
- request: HTTPRequest ,
871
- shouldRemoveSession: Bool
872
- ) async throws -> AuthResponse {
873
- if shouldRemoveSession {
874
- await sessionManager. remove ( )
875
- }
876
-
856
+ private func _verifyOTP( request: HTTPRequest ) async throws -> AuthResponse {
877
857
let response = try await api. execute ( request) . decoded (
878
858
as: AuthResponse . self,
879
859
decoder: configuration. decoder
@@ -897,10 +877,6 @@ public final class AuthClient: Sendable {
897
877
emailRedirectTo: URL ? = nil ,
898
878
captchaToken: String ? = nil
899
879
) async throws {
900
- if type != . emailChange {
901
- await sessionManager. remove ( )
902
- }
903
-
904
880
_ = try await api. execute (
905
881
HTTPRequest (
906
882
url: configuration. url. appendingPathComponent ( " resend " ) ,
@@ -934,11 +910,7 @@ public final class AuthClient: Sendable {
934
910
type: ResendMobileType ,
935
911
captchaToken: String ? = nil
936
912
) async throws -> ResendMobileResponse {
937
- if type != . phoneChange {
938
- await sessionManager. remove ( )
939
- }
940
-
941
- return try await api. execute (
913
+ try await api. execute (
942
914
HTTPRequest (
943
915
url: configuration. url. appendingPathComponent ( " resend " ) ,
944
916
method: . post,
0 commit comments