import { AppErrorCode } from '@documenso/lib/errors/app-error'; import { Button } from '@documenso/ui/primitives/button'; import { Trans } from '@lingui/react/macro'; import { AlertTriangleIcon } from 'lucide-react'; export type CscRecipientBlockedPageProps = { code: string; recipientToken: string; }; /** * Terminal page rendered when the service-scope CSC OAuth callback surfaces a * hard error the recipient can't resolve themselves (empty credential list, * invalid cert, refused algorithm). The blocking-error cookie is read + * cleared by the loader; this page only renders the message + retry CTA. * * The retry link kicks a fresh service-scope OAuth round-trip — useful when * the TSP-side issue is transient (e.g. the recipient's admin has since * provisioned a credential). */ export const CscRecipientBlockedPage = ({ code, recipientToken }: CscRecipientBlockedPageProps) => { const retryUrl = `/api/csc/oauth/authorize?scope=service&token=${encodeURIComponent(recipientToken)}`; return (

{code === AppErrorCode.CSC_CREDENTIAL_LIST_EMPTY ? ( No signing credentials available ) : code === AppErrorCode.CSC_CERT_INVALID ? ( Signing certificate is invalid ) : code === AppErrorCode.CSC_ALGORITHM_REFUSED ? ( Signing algorithm is not supported ) : ( Unable to start the signing flow )}

{code === AppErrorCode.CSC_CREDENTIAL_LIST_EMPTY ? ( Your signing provider returned no usable credentials for this account. Contact your administrator or signing provider for assistance. ) : code === AppErrorCode.CSC_CERT_INVALID ? ( Your signing certificate is invalid, expired, or missing a required key. Contact your administrator or signing provider for assistance. ) : code === AppErrorCode.CSC_ALGORITHM_REFUSED ? ( Your signing provider does not advertise a signing algorithm this document accepts. Contact your administrator or signing provider for assistance. ) : ( Something went wrong while preparing the remote signature. Please try again. )}

); };