Hi Michael,
I had the exact hope as you. I was hoping that the Firestore Tenant would isolate the data returned from Firestore to that Tenant's ID. This leaves all data isolation logic up to the developer! I am going to forget the first part of this query somewhere and company x is going to see company y's data...
return db.collection('jobs').where('tenantId', '==', user.tenantId).where('userId', '==', user.uid).limit(1).get();
I think a better solution would be to authenticate the user from a universal user list (not bound by tenant) if successful then apply the rest the application to restrict to this tenant only:
db.setTenant(user.tenantId); Done on the login control, never to be messed with in lower levels of code.
Then I can just focus on returning the data without polluting all the code with tenantIds (and probably forgetting some).
return db.collection('jobs').where('userId', '==', user.uid).limit(1).get();
Have you found a firestore solution to this anywhere?
Brett