@@ -26,6 +26,38 @@ const ERROR_DISPLAY: Record<string, { title: string; description: string }> = {
2626 title : "Invalid credentials" ,
2727 description : "The username or password was not accepted by the website." ,
2828 } ,
29+ totp_required : {
30+ title : "Authenticator code required" ,
31+ description : "An authenticator code is required." ,
32+ } ,
33+ sms_code_required : {
34+ title : "SMS code required" ,
35+ description : "A code sent by SMS is required." ,
36+ } ,
37+ email_code_required : {
38+ title : "Email code required" ,
39+ description : "A code sent by email is required." ,
40+ } ,
41+ account_choice_required : {
42+ title : "Account selection required" ,
43+ description :
44+ "An account or identity must be selected before login can continue." ,
45+ } ,
46+ customer_input_required : {
47+ title : "Additional input required" ,
48+ description :
49+ "Additional information is required before login can continue." ,
50+ } ,
51+ external_action_required : {
52+ title : "External action required" ,
53+ description :
54+ "An external action is required to continue. Check your authenticator app, email, or phone for a verification request." ,
55+ } ,
56+ totp_code_rejected : {
57+ title : "Authenticator code rejected" ,
58+ description :
59+ "The website rejected the authenticator code. Try a fresh code, or reconnect the account if generated codes keep failing across new code windows." ,
60+ } ,
2961 bot_detected : {
3062 title : "Verification required" ,
3163 description :
@@ -66,6 +98,10 @@ const ERROR_DISPLAY: Record<string, { title: string; description: string }> = {
6698 } ,
6799} ;
68100
101+ export function errorDisplayForCode ( errorCode ?: string ) {
102+ return errorCode ? ERROR_DISPLAY [ errorCode ] : undefined ;
103+ }
104+
69105function extractErrorText ( raw : string ) : string {
70106 try {
71107 const parsed = JSON . parse ( raw ) ;
@@ -92,7 +128,7 @@ export function StepError({
92128 const siteName = extractDomainName ( targetDomain ) ;
93129 const [ showDetails , setShowDetails ] = useState ( false ) ;
94130
95- const display = errorCode ? ERROR_DISPLAY [ errorCode ] : undefined ;
131+ const display = errorDisplayForCode ( errorCode ) ;
96132 const title = display ?. title ?? l . errorTitle ;
97133 const description = display ?. description ?? l . errorGenericMessage ;
98134
0 commit comments