feat(auth-server): copy local email codes to the clipboard#20922
Open
nshirley wants to merge 1 commit into
Open
feat(auth-server): copy local email codes to the clipboard#20922nshirley wants to merge 1 commit into
nshirley wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in local-dev enhancement to the auth-server mail helper to copy incoming authentication codes to the system clipboard, and documents how to use the local “inbox” mail capture service.
Changes:
- Add
MAIL_HELPER_COPY_CODES=1flag support totest/mail_helper.js, including platform-specific clipboard integration and startup status logging. - Copy received codes to the clipboard for multiple flows (signin/token/unblock/password reset/MFA/passwordless/recovery phone).
- Document local email/code retrieval workflow and the new flag in the auth-server README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/fxa-auth-server/test/mail_helper.js | Adds clipboard-copy feature gated by MAIL_HELPER_COPY_CODES, and invokes it when codes are received. |
| packages/fxa-auth-server/README.md | Documents the local “inbox” mail helper service and how to enable clipboard copying of codes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+138
to
+142
| } else if (vc) { | ||
| console.log('\x1B[32m', link || vc, '\x1B[39m'); | ||
| } else if (sc) { | ||
| console.log('\x1B[32mToken code: ', sc, '\x1B[39m'); | ||
| copyCode(sc); |
vpomerleau
approved these changes
Jul 24, 2026
vpomerleau
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this dev improvement 🪄 No comments beyond the copilot ones.
Because: * I got tired of copy/pasting codes between the terminal and the browser. This commit: * Adds MAIL_HELPER_COPY_CODES=1 to mail_helper, which copies each code to the local clipboard as it arrives. Off by default. * Copies whatever the helper logs, so flows that send a verification link instead of a code are covered too. * Logs the clipboard mode on startup so a missing env var is obvious. * Documents the inbox service and the new flag in the auth-server README, including a caution about clipboard history tools.
nshirley
force-pushed
the
inbox-code-watcher
branch
from
July 25, 2026 01:01
a4920cf to
63860a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
This pull request
MAIL_HELPER_COPY_CODES=1flag topackages/fxa-auth-server/test/mail_helper.jsthat copies each code to the local clipboard as it arrives, so it can be pasted straight into the browser.Clipboard copy: enabled (pbcopy)/disabledon startup next tomail_helper started..., so a missing env var is diagnosable at a glance rather than looking like a broken feature.inboxservice and the new flag under a "Local emails and codes" section inpackages/fxa-auth-server/README.md, which previously had no mention of how to retrieve a code locally.Issue that this pull request solves
Closes: N/A
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
The flag is off by default, so CI and local functional-test runs are unaffected —
copyCode()returns immediately unlessMAIL_HELPER_COPY_CODES=1, and no clipboard process is spawned. It resolvespbcopy/xclip/clipby platform and silently no-ops if the tool is missing, so it cannot take the mail helper down.No Jira ticket: local dev-tooling only, with no production code path or user-facing behaviour. No pre-merge review skill was run for the same reason.