capacitor-firebase-auth
capacitor-firebase-auth copied to clipboard
Possible bug on phone auth
Hello, thanks for the amazing work.
Suddenly my app stopped building, not sure if one of my deps updated or something. But suddenly this line stopped working...
https://github.com/baumblatt/capacitor-firebase-auth/blob/7a62d887e0189b2d4196d7dc519c14635e6deaae/ios/Plugin/Handlers/PhoneNumberProvider.swift#L34
I "patched it" like this, not sure if its the right approach?

Thnaks
It seems there was a breaking change
https://github.com/firebase/firebase-ios-sdk/issues/7723
+1
I had this same issue, and eventually just did this:
if let error = error {
let errCode = AuthErrorCode(AuthErrorCode.Code(rawValue: error._code) ?? AuthErrorCode.internalError)
switch errCode {
case AuthErrorCode.quotaExceeded:
call.reject("Quota exceeded.")
case AuthErrorCode.invalidPhoneNumber:
call.reject("Invalid phone number.")
case AuthErrorCode.captchaCheckFailed:
call.reject("Captcha Check Failed")
case AuthErrorCode.missingPhoneNumber:
call.reject("Missing phone number.")
default:
call.reject("PhoneAuth Sign In failure: \(String(describing: error))")
}
return
}
The issue looks to be related to how this library handles errors, and the authcodes that used to exist on firebase auth have changed.
Hopefully the maintainers of this library release an update to address this breaking change.
Yea, firebase update had a breaking change.
One question @Darrow8 , how do you override this code? Do you published another package to npm? Or how do you make sure other devs on your team get these changes?
I'm not a native dev so I struggled, forked and published a new package
https://github.com/betocantu93/capacitor-firebase-auth/tree/release-npm
published as bengala-capacitor-firebase-auth
@betocantu93 oh okay cool, I did not publish a new package, I just directly edited the library code for my local version.
@Darrow8 your fix worked for me, thanks. (I don't even use Phone auth and this error was blocking me.)
I think the maintainer, @baumblatt , needs some help or funding. I would absolutely contribute in whatever way possible. I am also not a native dev, but happy to contribute some money or JS code. @baumblatt please let us know what we can do to keep this library alive! Thanks for the work you've done so far.