@@ -22,7 +22,7 @@ interface CharterSigningInterfaceProps {
22
22
export function CharterSigningInterface ( { groupId, charterData, onSigningComplete, onCancel, onSigningStatusUpdate } : CharterSigningInterfaceProps ) {
23
23
const [ sessionId , setSessionId ] = useState < string | null > ( null ) ;
24
24
const [ qrData , setQrData ] = useState < string | null > ( null ) ;
25
- const [ status , setStatus ] = useState < "pending" | "connecting" | "signed" | "expired" | "error" > ( "pending" ) ;
25
+ const [ status , setStatus ] = useState < "pending" | "connecting" | "signed" | "expired" | "error" | "security_violation" > ( "pending" ) ;
26
26
const [ timeRemaining , setTimeRemaining ] = useState < number > ( 900 ) ; // 15 minutes in seconds
27
27
const [ eventSource , setEventSource ] = useState < EventSource | null > ( null ) ;
28
28
const { toast } = useToast ( ) ;
@@ -108,6 +108,13 @@ export function CharterSigningInterface({ groupId, charterData, onSigningComplet
108
108
description : "The signing session has expired. Please try again." ,
109
109
variant : "destructive" ,
110
110
} ) ;
111
+ } else if ( data . type === "security_violation" ) {
112
+ setStatus ( "security_violation" ) ;
113
+ toast ( {
114
+ title : "eName Verification Failed" ,
115
+ description : "eName verification failed. Please check your eID." ,
116
+ variant : "destructive" ,
117
+ } ) ;
111
118
} else {
112
119
console . log ( "SSE message:" , data ) ;
113
120
}
@@ -254,6 +261,31 @@ export function CharterSigningInterface({ groupId, charterData, onSigningComplet
254
261
) ;
255
262
}
256
263
264
+ if ( status === "security_violation" ) {
265
+ return (
266
+ < Card className = "w-full max-w-md mx-auto" >
267
+ < CardHeader className = "text-center" >
268
+ < CardTitle className = "flex items-center justify-center gap-2" >
269
+ < AlertTriangle className = "h-5 w-5 text-red-500" />
270
+ eName verification failed
271
+ </ CardTitle >
272
+ < CardDescription >
273
+ eName verification failed
274
+ </ CardDescription >
275
+ </ CardHeader >
276
+ < CardContent className = "text-center space-y-4" >
277
+ < div className = "bg-red-50 p-4 rounded-lg" >
278
+ < p className = "text-red-800 text-sm" >
279
+ eName Mismatch: It appears that you are trying to sign with the wrong eName.
280
+ Please make sure you are signing with the right eID linked to this account.
281
+ </ p >
282
+ </ div >
283
+ < Button onClick = { onCancel } variant = "secondary" > Close</ Button >
284
+ </ CardContent >
285
+ </ Card >
286
+ ) ;
287
+ }
288
+
257
289
return (
258
290
< Card className = "w-full max-w-md mx-auto" >
259
291
< CardHeader className = "text-center" >
0 commit comments