且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Cloud Functions 存储触发器中获取经过身份验证的 Firebase 用户的 uid

更新时间:2023-12-02 09:24:46

目前,使用 Cloud Storage 触发器,您无权访问经过身份验证的用户信息.要解决这个问题,您必须执行一些操作,例如将 uid 嵌入文件的路径中,或将 uid 作为元数据添加到文件上传中.

Currently, with Cloud Storage triggers, you don't have access to authenticated user information. To work around that, you'll have to do something like embed the uid in the path of the file, or add the uid as metadata in the file upload.