Repository navigation
Say what happened when a sign-in fails - #605
Merged
Merged
Conversation
A failed sign-in ended on a "page not found" (the callback sent the visitor to /auth/auth-code-error, which does not exist) or on the home page with the sign-in service's error in the address and nothing on the page. - /auth/callback now sends a failure to /login with our own short code (?error=several_accounts, cancelled, expired, unverified_email or failed) and keeps the page the visitor was heading for. The sign-in page shows the matching message above its buttons. - When the service sends a failure straight to a page (it does when it does not accept the address it was asked to return to), any page shows the message as a toast and takes the service's parameters out of the address. - The messages are ours. Text from the address is never shown, since anyone can write an address. - A failure is logged with the service's error code, so the reason can be found later. A successful sign-in goes where it did before. Co-authored-by: Cursor <cursoragent@cursor.com>
ericzakariasson
force-pushed
the
sign-in-error-message
branch
from
December 1, 2026 02:41
142fb06 to
bdbb829
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.
Summary
When a sign-in failed, the site said nothing. The visitor ended on "page not found" (the callback sent them to
/auth/auth-code-error, which does not exist), or on the home page with the sign-in service's error in the address and nothing on the page.Now a failed sign-in says what happened and what to do:
/auth/callbacksends a failure to the sign-in page with a short code of our own, and keeps the page the visitor was heading for. The sign-in page shows the matching message above its buttons.several_accountscancelledexpiredunverified_emailfailedThe messages are ours. Text from the address is never shown, since anyone can write an address. A successful sign-in goes where it did before.
Things to know
several_accountsis recognised by the wording of the service's description, because the service reports it under its general "unexpected failure" code. If that wording changes, the visitor gets the general message instead.expiredandunverified_emailcome from the auth library's list of error codes. I have only seenseveral_accountshappen for real.Testing
bunx biome ci .andbun run typecheckinapps/cursorpass./auth/callbackwith each kind of failure redirects to/loginwith the right code. That includes the exact failure a member reported, a missing code, and a code with no sign-in in progress.nextis kept when it is a path on the site and dropped when it points elsewhere.?q=) stay.?error=without the service's other parameters is left alone, and an unknown code on the sign-in page shows nothing./auth/callbackredirects the same way there, and the messages are in the page's scripts.