我需要在Web应用程序中注册Firebase中的许多生成用户.我没有在Firebase的API参考中找到任何方法来在一个请求中执行此操作,因此我为每个生成的对电子邮件/密码调用createUserWithEmailAndPassword.注册100个用户后,我收到了auth/too-many-requests错误,由于Firebase阻止了来自设备的所有请求,因此无法发送30分钟或更长时间的请求.
如何防止在firebase控制台中阻止我的应用程序或在Web应用程序的代码中写入什么?我正在使用标准的firebase连接:
const config = { apiKey: 'my-api-key', authDomain: 'my-project.firebaseapp.com', databaseURL: 'https://my-project.firebaseio.com', storageBucket: 'my-project.appspot.com', messagingSenderId: 'my-sender-id'}; firebase.initializeApp(config);
并使用createUserWithEmailAndPassword注册100个用户中的每一个:
firebase.auth().createUserWithEmailAndPassword(email, password)
我正在使用Promise.all调用所有请求
firebase.Promise.all(registerRequests)
其中注册请求是createUserWithEmailAndPassword promise
我建议使用Admin node.js SDK.您将拥有特权访问权限,可以根据需要创建任意数量的电子邮件和密码用户,而不会受到限制. https://firebase-dot-devsite.googleplex.com/docs/auth/admin/manage-users