Repository navigation
Let a coach join with an email or a mobile in one box - #24
Merged
Merged
Conversation
Text codes reach only +1 numbers, so a coach anywhere else could not get in. An email now gets a 6-digit code by email through the relay, a US or Canadian mobile still gets a text, and a foreign mobile is pointed to email. A coach with no phone gets the overflow question by email and answers it on the schedule screen, and can add a mobile there later. The relay email client is fixed to the relay's real shape. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Why
No coach could reliably join. Every path needed a texted code, and text codes reach only
+1numbers. The app enforces that (isDomesticDestination) and so does the relay (SMS_ALLOWED_PREFIXES="+1"). A coach outside the US and Canada, our tester among them, could not get past sign-in. uat and production have 0 coaches and have sent 0 texts.What changes
/signin: "Email or mobile number".coach.phoneis nullable.coach.emailis unique, case-insensitive.sendEmailMessageinsrc/domain/outbound.tslogs tomessage_logwithchannel='email'. SMS ceilings never count emails.src/relay/email.tshad never been called. It sent a SendGrid-shaped body from an unauthenticatednoreply@coachatron.com, so the relay would have answered 422. It now uses the relay's native shape. The sender is the relay's shared authenticated address with the name "Coachatron" untilCOACHATRON_EMAIL_FROMis set.Secureon https, and codes come fromcrypto.randomInt.Migration
0011_email_signinis additive: nullable phone, a unique email index, and a channel column. I checked development before writing it: 1 coach, no duplicate emails. uat and production have 0 coaches.No thirteenth screen: sign-in is screen 1, and the new cards are POST actions on screen 2.
Tests
test/email-signin.test.ts(8 tests):npm test118/118 on five consecutive full runs. Typecheck, lint (0 errors) and build pass.After merge (before telling the tester)
Sign in on development and uat with a real inbox, and on uat with a US mobile. Texting in (one Coachatron number) is the next PR.
🤖 Generated with Claude Code