Auth sample for 2nd gen - #1311
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a Node.js 2nd generation quickstart sample for Firebase Auth triggers that sends welcome and goodbye emails using Resend. Key feedback includes fixing a copy-paste logic error in sendGoodbyeEmail where a welcome greeting is used, adding guard clauses to handle users without email addresses in the email service, regenerating the lockfile to correctly lock resend instead of nodemailer, and removing a leftover TypeScript compile script from package.json.
egilmorez
left a comment
There was a problem hiding this comment.
One question one observation, thanks!
shettyvarun268
left a comment
There was a problem hiding this comment.
Minor changes. Thanks for the PR Jeff
| }, | ||
| "dependencies": { | ||
| "firebase-admin": "^14.2.0", | ||
| "firebase-functions": "^7.3.2", |
There was a problem hiding this comment.
These features will most likely be released on version 7.4.0. We might want to bump this up before final release.
There was a problem hiding this comment.
Varun is correct. For testing purposes we have the code usable in 7.3.3-rc.2
There was a problem hiding this comment.
^7.3.2 will pick up minor updates, so I'll leave as-is for now and update all samples to 7.4.0 when it is released
ajperel
left a comment
There was a problem hiding this comment.
Important that we fix firebase-functions version and one other suggestion, but I trust you to make these changes before merging.
| /** | ||
| * Deletes one inactive user from the list. | ||
| * @param {admin.auth.UserRecord[]} inactiveUsers | ||
| * @param {import("firebase-admin/auth").UserRecord[]} inactiveUsers |
There was a problem hiding this comment.
All these inline imports are pretty ugly and. wouldn't want a user to do this. Can't you import UserRecord once at the beginning of this file and then use it throughout?
| }, | ||
| "dependencies": { | ||
| "firebase-admin": "^14.2.0", | ||
| "firebase-functions": "^7.3.2", |
There was a problem hiding this comment.
This will need to be updated to ^7.4.0 when we merge. That should be the version we publish with the events
Samples for
onUserCreated,onUserDeleted, and multi-tenancy with GCIP.Snippets are in these files:
Node/quickstarts/email-users/functions/tenants.js
Node/quickstarts/email-users/functions/sendWelcomeEmail.js
Node/quickstarts/email-users/functions/sendByeEmail.js