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
{{ message }}
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
First time this works as expected, failing and rejecting the promise, console.log outputing the error message. Second time the promise is not rejected.
I've debugged this all the way to firebase.android.js, this line: var OnVerificationStateChangedCallbacks = com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks.extend({
The callbacks work as expected and actually call reject(errorMessage); but for some reason after the first failure any subsequent calls will not reject the promise.
I would be willing to help in fixing this (if indeed it is a bug) but I'm pretty new to Nativescript and mobile development and not sure what the extend() call is or how to debug native code. It seems to be the root of the problem. I have tried calling the callback directly on the object returned by extend and could reproduce.
UPDATE:
Isolated reproduction. Please note that it doesn't matter if it's a resolve or reject - it only works the first time.
reproduce().catch(console.log);
function reproduce() {
return new Promise((resolve, reject) => {
var OnVerificationStateChangedCallbacks = com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks.extend({
onVerificationCompleted: (phoneAuthCredential) => {
resolve(phoneAuthCredential);
},
onVerificationFailed: function (firebaseException) {
reject(firebaseException);
}
});
const cbs = new OnVerificationStateChangedCallbacks();
cbs.onVerificationFailed('something went wrong');
});
}
The text was updated successfully, but these errors were encountered:
jnorkus
changed the title
Login promise not rejected on second failure with LoginType.PHONE
Login with LoginType.PHONE only completes the promise for the first time
Mar 28, 2018
@EddyVerbruggen
The fix is not complete - this is not used in the onComplete callback. This results in promise not being resolved after first reject. Strangely though, the next time resolve is called it works.
Platform: Android
First time this works as expected, failing and rejecting the promise,
console.log
outputing the error message. Second time the promise is not rejected.I've debugged this all the way to
firebase.android.js
, this line:var OnVerificationStateChangedCallbacks = com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks.extend({
The callbacks work as expected and actually call
reject(errorMessage);
but for some reason after the first failure any subsequent calls will not reject the promise.I would be willing to help in fixing this (if indeed it is a bug) but I'm pretty new to Nativescript and mobile development and not sure what the
extend()
call is or how to debug native code. It seems to be the root of the problem. I have tried calling the callback directly on the object returned byextend
and could reproduce.UPDATE:
Isolated reproduction. Please note that it doesn't matter if it's a
resolve
orreject
- it only works the first time.The text was updated successfully, but these errors were encountered: