Sep 16, 2024
0
Level 1
Firebase Firestore update database docs with rules auth
I use vue js with firebase firestore database, I've changed my database rules to
allow read: if true; allow write: if request.auth != null;
how to config this auth in my project? anyone could help me pls? I could not find the docs about this rules and auth configuration
import { initializeApp } from "firebase/app";
import { getFirestore, onSnapshot, doc, updateDoc } from "firebase/firestore";
.......................................................
let docRef = doc(db, appConfig, appConfig.id);
...................................................
updateDoc(docRef, dataToUpdate).then(() => {
toast.add({
severity: "success",
summary: "Successful",
detail: `Data saved successfully`,
life: 3000,
});
emit("onSuccess");
})
it works fine with rules: allow write: if true, I wanna understand this rules and auth, pls.
Please or to participate in this conversation.