最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Firebase always returned "We have blocked all requests from this device due to unusual activity. Try again

programmeradmin1浏览0评论

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'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?

Share Improve this question edited Jun 18, 2019 at 19:33 Frank van Puffelen 601k85 gold badges890 silver badges860 bronze badges asked Jun 18, 2019 at 18:44 Sergey SerdukSergey Serduk 1131 silver badge9 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

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.

it was fixed without any fixes :) Seems like my IP was blocked by Firebase servers for several days, it works ok now

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论