@@ -108,28 +108,28 @@ class AuthBackend: AuthBackendProtocol {
108108 #if !os(iOS)
109109 return nil
110110 #else
111- if let mfaResponse = response as? AuthMFAResponse ,
112- mfaResponse. idToken == nil ,
113- let enrollments = mfaResponse. mfaInfo {
114- var info : [ MultiFactorInfo ] = [ ]
115- for enrollment in enrollments {
116- // check which MFA factors are enabled.
117- if let _ = enrollment. phoneInfo {
118- info. append ( PhoneMultiFactorInfo ( proto: enrollment) )
119- } else if let _ = enrollment. totpInfo {
120- info. append ( TOTPMultiFactorInfo ( proto: enrollment) )
121- } else {
122- AuthLog . logError ( code: " I-AUT000021 " , message: " Multifactor type is not supported " )
111+ if let mfaResponse = response as? AuthMFAResponse ,
112+ mfaResponse. idToken == nil ,
113+ let enrollments = mfaResponse. mfaInfo {
114+ var info : [ MultiFactorInfo ] = [ ]
115+ for enrollment in enrollments {
116+ // check which MFA factors are enabled.
117+ if let _ = enrollment. phoneInfo {
118+ info. append ( PhoneMultiFactorInfo ( proto: enrollment) )
119+ } else if let _ = enrollment. totpInfo {
120+ info. append ( TOTPMultiFactorInfo ( proto: enrollment) )
121+ } else {
122+ AuthLog . logError ( code: " I-AUT000021 " , message: " Multifactor type is not supported " )
123+ }
123124 }
125+ return AuthErrorUtils . secondFactorRequiredError (
126+ pendingCredential: mfaResponse. mfaPendingCredential,
127+ hints: info,
128+ auth: auth
129+ )
130+ } else {
131+ return nil
124132 }
125- return AuthErrorUtils . secondFactorRequiredError (
126- pendingCredential: mfaResponse. mfaPendingCredential,
127- hints: info,
128- auth: auth
129- )
130- } else {
131- return nil
132- }
133133 #endif // !os(iOS)
134134 }
135135
0 commit comments