import * as Sentry from '@sentry/nextjs' import { SupportCategories } from '@supabase/shared-types/out/constants' import { useEffect } from 'react' import { toast } from 'sonner' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Button, } from 'ui' import { CollapsibleAlert } from 'ui-patterns/collapsible-alert' import { SupportLink } from '../Support/SupportLink' import { InlineLink, InlineLinkClassName } from '@/components/ui/InlineLink' interface SessionTimeoutModalProps { visible: boolean onClose: () => void redirectToSignIn: () => void /** Optional context so the support form can pre-populate when opened from this dialog */ supportContext?: { projectRef?: string; orgSlug?: string } } export const SessionTimeoutModal = ({ visible, onClose, redirectToSignIn, supportContext, }: SessionTimeoutModalProps) => { useEffect(() => { if (visible) { Sentry.captureException(new Error('Session error detected')) } }, [visible]) const handleClearStorage = () => { try { localStorage.clear() sessionStorage.clear() } catch (e) { toast.error('Failed to clear browser storage') } window.location.reload() } return ( { if (!open) onClose() }} > Session expired

Please sign in again to continue.

Try a different browser or disable extensions that block network requests. If the problem persists:

Still stuck?{' '} Contact support {' '} and include a{' '} HAR file {' '} from your session to help us investigate.

Close Sign in again
) }