@@ -236,7 +236,7 @@ import Foundation
236236 retryOnInvalidAppCredential: Bool ,
237237 uiDelegate: AuthUIDelegate ? ,
238238 recaptchaVerifier: AuthRecaptchaVerifier ) async throws
239- -> String {
239+ -> String ? {
240240 let request = SendVerificationCodeRequest ( phoneNumber: phoneNumber,
241241 codeIdentity: CodeIdentity . empty,
242242 requestConfiguration: auth
@@ -269,7 +269,7 @@ import Foundation
269269 retryOnInvalidAppCredential: Bool ,
270270 uiDelegate: AuthUIDelegate ? ,
271271 auditFallback: Bool = false ) async throws
272- -> String {
272+ -> String ? {
273273 let codeIdentity = try await verifyClient ( withUIDelegate: uiDelegate)
274274 let request = SendVerificationCodeRequest ( phoneNumber: phoneNumber,
275275 codeIdentity: codeIdentity,
@@ -375,7 +375,7 @@ import Foundation
375375 multiFactorSession session: MultiFactorSession ? ,
376376 uiDelegate: AuthUIDelegate ? ,
377377 auditFallback: Bool = false ) async throws
378- -> String {
378+ -> String ? {
379379 if let settings = auth. settings,
380380 settings. isAppVerificationDisabledForTesting {
381381 let request = SendVerificationCodeRequest (
@@ -413,20 +413,14 @@ import Foundation
413413 enrollmentInfo: startMFARequestInfo,
414414 requestConfiguration: auth. requestConfiguration)
415415 let response = try await auth. backend. call ( with: request)
416- guard let sessionInfo = response. phoneSessionInfo? . sessionInfo else {
417- throw AuthErrorUtils . error ( code: . missingMultiFactorInfo)
418- }
419- return sessionInfo
416+ return response. phoneSessionInfo? . sessionInfo
420417 } else {
421418 let request = StartMFASignInRequest ( MFAPendingCredential: session. mfaPendingCredential,
422419 MFAEnrollmentID: session. multiFactorInfo? . uid,
423420 signInInfo: startMFARequestInfo,
424421 requestConfiguration: auth. requestConfiguration)
425422 let response = try await auth. backend. call ( with: request)
426- guard let sessionInfo = response. responseInfo. sessionInfo else {
427- throw AuthErrorUtils . error ( code: . multiFactorInfoNotFound)
428- }
429- return sessionInfo
423+ return response. responseInfo. sessionInfo
430424 }
431425 } catch {
432426 return try await handleVerifyErrorWithRetry (
@@ -446,7 +440,7 @@ import Foundation
446440 retryOnInvalidAppCredential: Bool ,
447441 multiFactorSession session: MultiFactorSession ? ,
448442 uiDelegate: AuthUIDelegate ? ,
449- auditFallback: Bool = false ) async throws -> String {
443+ auditFallback: Bool = false ) async throws -> String ? {
450444 if ( error as NSError ) . code == AuthErrorCode . invalidAppCredential. rawValue {
451445 if retryOnInvalidAppCredential {
452446 auth. appCredentialManager. clearCredential ( )
0 commit comments