Skip to content

Add beforeSendEmail and beforeSendSms blocking functions samples#1253

Merged
jhuleatt merged 5 commits intofirebase:mainfrom
macastelaz:add-before-send-samples
Apr 6, 2026
Merged

Add beforeSendEmail and beforeSendSms blocking functions samples#1253
jhuleatt merged 5 commits intofirebase:mainfrom
macastelaz:add-before-send-samples

Conversation

@macastelaz
Copy link
Copy Markdown
Contributor

Supplement samples in Node and Python to include examples of beforeSendEmail and beforeSendSms

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new Firebase Auth Blocking functions for both Node.js and Python quickstarts. It adds beforeEmailSent and beforeSmsSent triggers to block email sending to non-acme.com domains and SMS sending to non-US phone numbers. The review comments suggest minor readability improvements in the Node.js functions by explicitly checking for the existence of user.email and user.phoneNumber before calling string methods, even though optional chaining provides functional safety.

@macastelaz macastelaz force-pushed the add-before-send-samples branch 2 times, most recently from b71c7de to d41d3a8 Compare April 1, 2026 00:56
@macastelaz macastelaz force-pushed the add-before-send-samples branch from d41d3a8 to b87ceec Compare April 1, 2026 01:13
@jhuleatt jhuleatt self-requested a review April 3, 2026 14:12
Copy link
Copy Markdown
Collaborator

@jhuleatt jhuleatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @macastelaz! I added some refinement suggestions but overall LGTM

Refactor error handling to improve readability by formatting error messages across multiple lines.
@jhuleatt jhuleatt merged commit 588cdbb into firebase:main Apr 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants