// Duplicate Identity Overlay // Purpose: Blocks an older non-verified driver tab after the server detects the same identity in another driver tab. // Scope: Presents a driver-page-only message while leaving enforcement owned by the server. import { useSessionSelector } from '../../context/SessionContext.jsx'; export default function DuplicateIdentityOverlay() { const duplicateIdentityBlock = useSessionSelector((state) => state.duplicateIdentityBlock); if (!duplicateIdentityBlock) { return null; } const message = typeof duplicateIdentityBlock?.message === 'string' && duplicateIdentityBlock.message.trim() ? duplicateIdentityBlock.message.trim() : 'This driver session is already active in another tab.'; return (
{message}
Continue from the newest tab or close this one.
Verified users are allowed to keep multiple tabs open.