verify = async () => {
this.isProcessing = true
this.isRegistering = true
const phoneNumber = `${this.currentUser.phoneDialCode}${this.currentUser.phoneNumber}`
// Get reference to the currently signed-in user
this.prevUser = firebase.auth().currentUser
console.log('prev user', this.prevUser)
await firebase.auth().signInWithPhoneNumber(phoneNumber)
.then(async (results) => {
this.isProcessing = false
this.verificationCode = results
console.log('=================================')
console.log('RESULTS', this.verificationCode)
console.log('=================================')
if (!this.verificationCode.verificationId) {
this.triggerAlert(
'Error',
'Phone number might have been blocked because of too much use.',
() => true,
)
await firebase.auth().verifyPhoneNumber(phoneNumber).then((res) => {
console.log('ver phon', res)
})
}
console.log('=================================')
console.log('Current User', firebase.auth().currentUser)
console.log('=================================')
}).catch((error) => {
this.isProcessing = false
this.loginOldUser()
// this.prevUser = new User()
this.triggerAlert(
'Error',
'Phone number format might not be correct. Please check again.',
() => true,
)
this.isPhoneVerified = false
this.currentUser.phoneFlag = ''
this.currentUser.phoneCode = ''
this.currentUser.phoneDialCode = ''
this.currentUser.phoneNumber = ''
})
}
因此,由于某些原因,在多次使用我的电话号码后,它不再返回仅空值的正确值。我已经有一段时间没有使用它们了,所以我不确定是怎么回事。我正在尝试重新发送代码,这就是为什么我不使用白名单中的数字。
我添加了验证电话号码只是为了看看它可以为我的问题提供更多的见识。
对此有何想法?谢谢!
因为您说: