Reauth Gate

Reauth Gate is a copy-paste React component that stops helps prevent a sensitive action on an unattended signed-in screen before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/reauth-gate
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsHelps prevent a sensitive action on an unattended signed-in screen

Was this component page useful?

How do I install Reauth Gate?

pnpm dlx shadcn@latest add @bollard/reauth-gate

The files land in your project. They're yours to edit.

What input mistakes does Reauth Gate catch?

  • Sensitive action started without a recent re-confirmation
  • Names the exact action and the reason before asking
  • Runs the queued action right after a successful verify
  • Shows how long the unlock lasts, with a button to end it early
  • Wrong credential or a rejected verify shows an error and keeps the action queued

What props does Reauth Gate accept?

ReauthGate props
PropTypeDefault
verify* (required)

Check the credential. Resolve true to unlock; false (or a rejection) counts as a wrong attempt.

(credential: ReauthCredential) => boolean | Promise<boolean>—
methods

Offered methods, preferred first.

ReauthMethod[]["passkey", "password"]
duration

How long a confirmation is remembered, in ms. Every protected action resets it.

number5 * 60_000
reason

Why this area asks again, shown in the prompt.

string"This changes who can get into your account, so we check …
children* (required)

Render the protected UI. Call `protect(label, action)` from sensitive buttons.

(protect: Protect, state: { unlocked: boolean }) => React.ReactNode—
promptText

Templates: `{action}`, `{time}` are filled in.

string"Confirm it's you to {action}."
rememberText

Shown after confirming. `{time}` is how long the unlock lasts.

string"You won't be asked again for {time}."
wrongText

Shown when verify returns false or rejects.

string"That didn't match. Try again."
cancelledText

Shown when the user cancels the prompt.

string"Cancelled. Nothing was changed."
chipText

Countdown chip text. `{time}` is filled in.

string"Confirmed · {time}"
endLabel

Label of the button that ends the unlock early.

string"End now"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Reauth Gate accessible?

  • Prompt is a labelled region (role=region with aria-labelledby); focus moves to its first control when it opens
  • Escape cancels the prompt
  • Method switch uses aria-pressed buttons in a labelled group
  • Credential input has a sr-only label, aria-invalid on a wrong attempt, and a polite live message
  • Countdown chip is role=timer with an aria-label; its progress animation is skipped under reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Re-check the credential and a server-side recent-auth timestamp on every sensitive endpoint, and rate-limit verify; the client window is only a convenience.

  • The unlock window lives in component state only; a reload, another tab or a direct API call is not covered
  • Security depends entirely on your verify function and your server
  • No attempt limit or lockout; rate-limit verification on the server
  • Passkey mode calls verify with no secret; you run the WebAuthn ceremony inside verify

What expensive mistakes does Reauth Gate stop?

Helps prevent a sensitive action on an unattended signed-in screen

Also known as

sudo mode · re-authenticate · confirm password · passkey · pin · step-up auth · verify identity · mpin

Field type

What dependencies does Reauth Gate require?

Reauth Gate facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameReauth Gate
Registry identifier@bollard/reauth-gate
Install commandnpx shadcn@latest add @bollard/reauth-gate
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Reauth Gate

How does Reauth Gate protect destructive mutations?

Reauth Gate prevents a sensitive action on an unattended signed-in screen. Enforces deliberate friction against Sensitive action started without a recent re-confirmation, Names the exact action and the reason before asking, Runs the queued action right after a successful verify, Shows how long the unlock lasts, with a button to end it early, Wrong credential or a rejected verify shows an error and keeps the action queued. Limitation: authorize reauth-gate mutations on the server.

How do I install reauth-gate with shadcn?

Run `npx shadcn@latest add @bollard/reauth-gate`. Sources added: registry/default/reauth-gate/reauth-gate.tsx. Package requirements: lucide-react.

What props customize Reauth Gate?

Reauth Gate accepts `verify`, `methods`, `duration`, `reason`, `children`. Configures sudo mode, re-authenticate, confirm password behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of reauth-gate?

The unlock window lives in component state only; a reload, another tab or a direct API call is not covered. Security depends entirely on your verify function and your server. No attempt limit or lockout; rate-limit verification on the server. Passkey mode calls verify with no secret; you run the WebAuthn ceremony inside verify Server requirement: Re-check the credential and a server-side recent-auth timestamp on every sensitive endpoint, and rate-limit verify; the client window is only a convenience.

How does Reauth Gate meet accessibility guidelines?

Prompt is a labelled region (role=region with aria-labelledby); focus moves to its first control when it opens. Escape cancels the prompt. Method switch uses aria-pressed buttons in a labelled group. Credential input has a sr-only label, aria-invalid on a wrong attempt, and a polite live message. Countdown chip is role=timer with an aria-label; its progress animation is skipped under reduced motion. Minimizes errors: no password confirm before delete, sudo mode.

Which components pair with Reauth Gate?