This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -143,9 +143,10 @@ export const firebase: any = {
143143 requestPhoneAuthVerificationCode : ( onUserResponse , verificationPrompt ) => {
144144 prompt ( verificationPrompt || "Verification code" ) . then ( promptResult => {
145145 if ( ! promptResult . result ) {
146- return ;
146+ onUserResponse ( undefined ) ;
147+ } else {
148+ onUserResponse ( promptResult . text ) ;
147149 }
148- onUserResponse ( promptResult . text ) ;
149150 } ) ;
150151 } ,
151152 // for backward compatibility, because plugin version 4.0.0 moved the params to per-logintype objects
Original file line number Diff line number Diff line change @@ -878,6 +878,10 @@ firebase.login = arg => {
878878 if ( firebase . _verifyPhoneNumberInProgress ) {
879879 firebase . _verifyPhoneNumberInProgress = false ;
880880 firebase . requestPhoneAuthVerificationCode ( userResponse => {
881+ if ( userResponse === undefined && this . reject ) {
882+ this . reject ( "Prompt was canceled" ) ;
883+ return ;
884+ }
881885 const authCredential = com . google . firebase . auth . PhoneAuthProvider . getCredential ( verificationId , userResponse ) ;
882886 const user = com . google . firebase . auth . FirebaseAuth . getInstance ( ) . getCurrentUser ( ) ;
883887
Original file line number Diff line number Diff line change @@ -779,6 +779,10 @@ firebase.login = arg => {
779779 }
780780
781781 firebase . requestPhoneAuthVerificationCode ( userResponse => {
782+ if ( userResponse === undefined ) {
783+ reject ( "Prompt was canceled" ) ;
784+ return ;
785+ }
782786 const fIRAuthCredential = FIRPhoneAuthProvider . provider ( ) . credentialWithVerificationIDVerificationCode ( verificationID , userResponse ) ;
783787 if ( fAuth . currentUser ) {
784788 const onCompletionLink = ( authData : FIRAuthDataResult , error : NSError ) => {
You can’t perform that action at this time.
0 commit comments