In the Firestore docs, one recommended way of writing security rules is
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, update, delete: if request.auth.uid == userId;
allow create: if request.auth.uid != null;
}
}
}
However, when I create a user the userID is different from the auth.uid (both are random strings, but totally random).
How do I make them match automatically when a new user is created?