-
Notifications
You must be signed in to change notification settings - Fork 41
Labels
domain:authSomething related to authSomething related to authplatform:backendBackend / cloud functionsBackend / cloud functionspriority:low 🏖️Low priority issueLow priority issuetype:enhancement 😃New feature or requestNew feature or request
Milestone
Description
Description:
This issue aims to create a Firebase Cloud Function that triggers on the creation of a document in the tanam-users/{docId}
collection. When a new user document is created, the function should set the user's name
attribute in the Firestore document to the displayName
from the Firebase Auth user object.
Objectives:
-
Create onDocumentCreated Trigger:
- Implement a Firebase Cloud Function that triggers when a new document is created in the
tanam-users/{docId}
collection.
- Implement a Firebase Cloud Function that triggers when a new document is created in the
-
Fetch DisplayName from Firebase Auth:
- Fetch the
displayName
attribute from the corresponding Firebase Auth user object using the UID from the newly created document. (https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.userrecord.md#userrecorddisplayname)
- Fetch the
-
Update Firestore Document:
- Set the
name
attribute in the Firestore document to the fetcheddisplayName
.
- Set the
Acceptance Criteria:
- A Firebase Cloud Function is created that triggers on document creation in the
tanam-users/{docId}
collection. - The function fetches the
displayName
from the Firebase Auth user object using the document ID as the UID. - The function updates the
name
attribute in the Firestore document with the fetcheddisplayName
. - Ensure proper error handling in case the
displayName
is not available or the user does not exist in Firebase Auth.
Notes:
- Verify that the function works correctly by creating new user documents and checking that the
name
attribute is correctly set from the Firebase AuthdisplayName
. - Ensure that the function has appropriate permissions to read from Firebase Auth and write to Firestore.
Metadata
Metadata
Assignees
Labels
domain:authSomething related to authSomething related to authplatform:backendBackend / cloud functionsBackend / cloud functionspriority:low 🏖️Low priority issueLow priority issuetype:enhancement 😃New feature or requestNew feature or request
Type
Projects
Status
Done