You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw a new major version was published (11.0.0) so I tried to upgrade to it. Everything seems smooth except for AuthErrorCode. We have a few places where we checked if the error returned was of such type, and if it was, we checked the code and in a specific case the localizedDescription because the error wouldn't tells us exactly what happened. Here are the two instances where we have such behavior:
Just checking the code:
if let firebaseError = error as?AuthErrorCode, firebaseError.code ==.networkError {
// Don't logout if the error is that the network is down!
returnnil}else{try?awaitlogoutSignedInUser(userInitiated: false)onUnrecoverableAuthError?()}
Checking code and localizedDescription to disambiguate the real error:
if let firebaseError = error as?AuthErrorCode, firebaseError.code ==.invalidPhoneNumber {
switch firebaseError.localizedDescription {case"TOO_SHORT":throwFirebaseError.phoneNumberTooShort
case"TOO_LONG":throwFirebaseError.phoneNumberTooLong
default:throw firebaseError
}}else{throw error
}
Description
I saw a new major version was published (11.0.0) so I tried to upgrade to it. Everything seems smooth except for
AuthErrorCode
. We have a few places where we checked if the error returned was of such type, and if it was, we checked thecode
and in a specific case thelocalizedDescription
because the error wouldn't tells us exactly what happened. Here are the two instances where we have such behavior:Just checking the
code
:Checking
code
andlocalizedDescription
to disambiguate the real error:After updating to 11.0.0 this code no longer compiles, and I didn't see any breaking changes about this on the Auth part of the release notes: https://firebase.google.com/support/release-notes/ios#authentication.
Reproducing the issue
Upgrade from 10.29.0 to 11.0.0 and use
AuthErrorCode
anywhere in your codebase.Firebase SDK Version
11.0.0
Xcode Version
15.4
Installation Method
Swift Package Manager
Firebase Product(s)
Authentication
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetThe text was updated successfully, but these errors were encountered: