Is it possible to get the uid of the user who triggered a cloud function through the context.auth property when using firestore?
exports.updateReport = functions.firestore
.document('groups/{groupId}/reports/{nursingId}')
.onUpdate((change, context) => {
const uid : string | undefined = context.auth?.uid;
})
I found a lot of old questions concerning the same problem with many different responses. (the feature works, the feature will maybe sometime work or that the feature will never work)
In my local setup I context.auth
is always undefined so I don't know if I am making a mistake or it doesn't even work at all. And if that is the case, is there any other secure way to get the uid of the user, who triggered the corresponding cloud function?