"Request.user is undefined" in beforeSave when using Master Key

Hi there,

Have a some issues with useMasterKey in cloud function.

Iā€™m trying to use useMasterKey in a cloud function to save an object. And in beforeSave Trigger I need to know whether the request has useMasterKey set to true.

Issue: in beforeSave the request.user is always undefined when using master key

Much appreciated

there has to be a way to know if that request was run with master key or not, you can print the entire request parameter to see what is there

Thanks.

request.master is true when using the master key.

But there seems no way to get request.user in this case.

there may be no request.user in that case when the master key is used