Repository navigation
Send a dead confirmation link back into the app, not to raw JSON - #52
Merged
Merged
Conversation
The confirmation email is the first thing a new teacher does. Clicking a
link that no longer works answered with a JSON body, which the browser
renders as one bare line of Hebrew on a white page:
{"message":"אימות נכשל או שפג תוקף הקישור."}
No way back, no way to ask for a new link, at step one of using the product.
The reasons are ordinary: a link older than its lifetime, or one a mail
client wrapped and cut in half.
The success path already redirected into the app; failures now do the same,
to /login?confirmed=0. The login screen explains what happened and offers to
send a new link — reusing the resend that was already there for a sign-in
blocked on an unverified address. That path only knew the address from a
failed sign-in, so it now also takes the one being typed into the form, and
says so if the field is empty.
Adds three cases to AuthFlowTests: a token that is not hers, a link that
lost its token, and a link with nothing left on it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
I walked the new-teacher onboarding end to end for the first time: register → confirmation email → confirm → sign in. Registration and the email are fine. The link's failure path is not.
Before
The browser renders that as one bare line on a white page. No way back to the app, no way to ask for a new link — at step one of using the product. The second case is worse: she gets an English stack-trace-shaped blob.
Neither reason is exotic. A link older than its lifetime does it, and so does a mail client that wraps a long URL and cuts it.
The success path already redirected into the app. Only the failures didn't.
After
And on the screen she lands on:
The resend itself was already there — it just only ran after a sign-in blocked on an unverified address, so it only ever knew the address from that attempt. It now also takes the one being typed into the form:
And a real email goes out — not just a reassuring message. Counted in the mail sink for a fresh, still-unverified account:
So the recovery actually recovers.
Checked and left alone
Testing
dotnet test— 250 passing, including three new cases inAuthFlowTests: a token that is not hers, a link that lost its token, and a link with nothing left on it.npx ng buildandnpx vitest run— clean, 30 passing.Demo data untouched — the two accounts registered for this walkthrough were deleted, and the teacher list is back to the original four.