I have some firebase projects.
Auth project for sign. And firestore project for storing.
Rules for firestore project is
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
Previously, I used firebase admin sdk via firebase functions to get whole controls of firestore project.
Is it possible to use auth for firestore on client when rules are like below
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;;
}
}
}
Briefly, I've implemented...
if (!this.auth && !_auth) {
this.authApp = firebase.initializeApp(Env.FirebaseAuthConfig, 'auth')
this.auth = this.authApp.auth()
}
if (!this.firestore && !_firestore) {
this.firestoreApp = firebase.initializeApp(Env.FirebaseFirestoreConfig, 'firestore')
this.firestoreApp.auth(this.authApp)
this.firestore = this.firestoreApp.firestore()
}
But FirebaseError: Missing or insufficient permissions occurred on request
Please give me some advices