-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add samples for Firestore with Auth context #1132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…/functions-samples into jhuleatt-firestore-auth-context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides some minor fixes
} | ||
|
||
// add auth medadata to the document | ||
return data.after.ref.set( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this needs to be snapshot.ref.set(...)
instead of data.after.ref.set(...)
// add auth medadata to the document | ||
return data.after.ref.set( | ||
{ | ||
created_by: authId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case authId is undefined, we need: created_by: authId ?? "undefined"
, since Firestore doesn't allow using undefined
as a property value by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.