Skip to content

Commit

Permalink
fix(authentication): empty verification ID on phone auth (#520)
Browse files Browse the repository at this point in the history
* fix(authentication): iOS: do not ignore errors in verifyPhoneNumber

* remove exclamation mark

* Update khaki-maps-carry.md

---------

Co-authored-by: Robin Genz <mail@robingenz.dev>
  • Loading branch information
DmitrySboychakov and robingenz committed Dec 14, 2023
1 parent b568914 commit 0e0bc8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-maps-carry.md
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/authentication': patch
---

fix(ios): empty verification ID on phone auth
Expand Up @@ -39,8 +39,13 @@ class PhoneAuthProviderHandler: NSObject {

private func verifyPhoneNumber(_ options: SignInWithPhoneNumberOptions) {
PhoneAuthProvider.provider()
.verifyPhoneNumber(options.getPhoneNumber(), uiDelegate: nil) { verificationID, _ in
self.pluginImplementation.handlePhoneCodeSent(verificationID ?? "")
.verifyPhoneNumber(options.getPhoneNumber(), uiDelegate: nil) { verificationID, error in
if let error = error {
self.pluginImplementation.handlePhoneVerificationFailed(error)
} else {
self.pluginImplementation.handlePhoneCodeSent(verificationID ?? "")
}
}
}

}

0 comments on commit 0e0bc8a

Please sign in to comment.