@@ -22,7 +22,7 @@ interface CharterSigningInterfaceProps {
2222export function CharterSigningInterface ( { groupId, charterData, onSigningComplete, onCancel, onSigningStatusUpdate } : CharterSigningInterfaceProps ) {
2323 const [ sessionId , setSessionId ] = useState < string | null > ( null ) ;
2424 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" ) ;
2626 const [ timeRemaining , setTimeRemaining ] = useState < number > ( 900 ) ; // 15 minutes in seconds
2727 const [ eventSource , setEventSource ] = useState < EventSource | null > ( null ) ;
2828 const { toast } = useToast ( ) ;
@@ -108,6 +108,13 @@ export function CharterSigningInterface({ groupId, charterData, onSigningComplet
108108 description : "The signing session has expired. Please try again." ,
109109 variant : "destructive" ,
110110 } ) ;
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+ } ) ;
111118 } else {
112119 console . log ( "SSE message:" , data ) ;
113120 }
@@ -254,6 +261,31 @@ export function CharterSigningInterface({ groupId, charterData, onSigningComplet
254261 ) ;
255262 }
256263
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+
257289 return (
258290 < Card className = "w-full max-w-md mx-auto" >
259291 < CardHeader className = "text-center" >
0 commit comments