Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.FirebaseApp
import dev.gitlive.firebase.FirebaseException
import dev.gitlive.firebase.FirebaseNetworkException
import dev.gitlive.firebase.FirebaseTooManyRequestsException
import dev.gitlive.firebase.auth.ActionCodeResult.*
import dev.gitlive.firebase.ios
import kotlinx.cinterop.*
Expand Down Expand Up @@ -164,7 +165,7 @@ public actual open class FirebaseAuthEmailException(message: String) : FirebaseA
public actual open class FirebaseAuthInvalidCredentialsException(message: String) : FirebaseAuthException(message)
public actual open class FirebaseAuthWeakPasswordException(message: String) : FirebaseAuthInvalidCredentialsException(message)
public actual open class FirebaseAuthInvalidUserException(message: String) : FirebaseAuthException(message)
public actual open class FirebaseAuthMultiFactorException(message: String) : FirebaseAuthException(message)
public actual open class FirebaseAuthMultiFactorException(message: String, public val resolver: FIRMultiFactorResolver?) : FirebaseAuthException(message)
public actual open class FirebaseAuthRecentLoginRequiredException(message: String) : FirebaseAuthException(message)
public actual open class FirebaseAuthUserCollisionException(message: String) : FirebaseAuthException(message)
public actual open class FirebaseAuthWebException(message: String) : FirebaseAuthException(message)
Expand Down Expand Up @@ -241,7 +242,13 @@ private fun NSError.toException() = when (domain) {
17078L, // AuthErrorCode.secondFactorRequired
17088L, // AuthErrorCode.maximumSecondFactorCountExceeded
17084L, // AuthErrorCode.multiFactorInfoNotFound
-> FirebaseAuthMultiFactorException(toString())
-> {
val resolver = userInfo["FIRAuthErrorUserInfoMultiFactorResolverKey"] as? FIRMultiFactorResolver
FirebaseAuthMultiFactorException(toString(), resolver)
}

17052L, // AuthErrorCode.quotaExceeded
-> FirebaseTooManyRequestsException(toString())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches the behaviour of android


17007L, // AuthErrorCode.emailAlreadyInUse
17012L, // AuthErrorCode.accountExistsWithDifferentCredential
Expand Down
Loading