1
我正在构建vuejs应用程序,并且正在尝试将Firebase验证添加到应用程序。我使用云端firestore来建立新闻系统。Firebase云防火墙+验证:只写登录用户
现在的“添加新闻”页上的我叫
firebase.auth().signInWithEmailAndPassword("[email protected]", "mypassword").catch(function (error) {
console.log(error.code);
console.log(error.message);
if (errorCode === 'auth/wrong-password') {
alert('Wrong password.');
} else {
alert(errorMessage);
}
});
登录用户,或给他的反馈,如果出事了。
后来我喜欢这个
irestore.collection("news").doc().set({
date: today,
title: "Hello",
text: "A think I am a news!"
});
写数据到云公司的FireStore在公司的FireStore规则我设置
allow read, write: if request.auth != null;
的新闻收集 - 所以应该只授予登录用户的写权限, 对?
现在事情: 如果我有一个错误的密码登录,火力点还给,该密码是不正确的(所以我们不都是我们登录?),但该数据被写入到反正公司的FireStore。我做错了什么?