Reputation: 113
I'm trying to make Email verification on my react-native app. Signup works only on back-end part, so I just need to verify emails for signed up users. Here is my code
firebase.auth().signInWithEmailAndPassword(email, password)
.then((returnedUser) => {
let user = firebase.auth().currentUser;
console.log(user);
user.sendEmailVerification()
.then(function(response) {
console.log('email', response);
})
.catch(function(error) {
console.log('error', error)
});
})
.catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode === 'auth/wrong-password') {
alert('Wrong password.');
} else {
alert(errorMessage);
}
});
I get an error "We have blocked all requests from this device due to unusual activity. Try again later." Seems like it's bad to have Firebase promise inside another one Promise, but I don't know how to resolve it without two Promises, anyone can help me?
Upvotes: 3
Views: 7224
Reputation: 113
it was fixed without any fixes :) Seems like my IP was blocked by Firebase servers for several days, it works ok now
Upvotes: 1
Reputation: 30788
You are sending the email verification too many times to the same user within a short internal of time. You may want to wait a minute or so before you resend a verification link to the same user. Sometimes, emails are delayed.
Upvotes: 2