fix(auth): show only known sign-in error codes

Sign-in errors arrive in the query string, so unknown codes get a fixed
message instead of being echoed into the banner.
This commit is contained in:
Alexa
2026-10-25 15:54:51 +02:00
parent 891ec89899
commit 5bfa463528
4 changed files with 13 additions and 6 deletions
+6
View File
@@ -46,6 +46,12 @@ export const LINK_ERRORS: Record<string, string> = {
no_pending_identity: 'Your sign-in expired. Start again with "Sign in".',
};
/** Friendly copy for a known error code, else `fallback`. For codes read from
* the query string, pass a fixed fallback: anyone can put text in a link. */
export function errorCopy(map: Record<string, string>, code: string | null | undefined, fallback: string): string {
return code && Object.hasOwn(map, code) ? map[code] : fallback;
}
export const SIGNIN_ERRORS: Record<string, string> = {
account_unavailable: 'The account linked to this sign-in is unavailable (deleted or banned).',
no_identity: "The sign-in provider didn't return an identity. Try again.",