Revoke Access Preview

Shows what removing a member, token or app will break: owned work left unowned, sessions ended and integrations that stop.

StopsRemoved member's integrations stopped working

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/revoke-access-preview.json

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

Usage

revoke-access-preview-usage.tsx
import { RevokeAccessPreview, type ActiveSession, type Reassignment, } from "@/components/ui/revoke-access-preview"

<RevokeAccessPreview
  key={run}
  name="Rahul Mehta"
  access={["Edit 4 projects and billing settings", "Use 2 personal API tokens"]}
  owned={OWNED}
  assignees={ASSIGNEES}
  defaultValue={{ p1: "u_sara" }}
  sessions={sessions}
  integrations={INTEGRATIONS}
  onConfirm={(reassign) => new Promise<void>((resolve) => setTimeout(() => {
    setResult(reassign)
    resolve()
  }, 600))}
  onCancel={() => setRun((n) => n + 1)}
/>

What it catches

  • Owned items left without an owner, with reassign-to and reassign-all
  • Sessions that end, flagging any active within liveWithin
  • Integrations that stop because they run on that person's credentials
  • Integrations that keep running because they belong to the workspace
  • Confirm label that names how many items stay unowned

Props

RevokeAccessPreview props
PropTypeDefault
name* (required)

Who or what is losing access, e.g. "Rahul Mehta" or "ci-deploy token".

string—
access* (required)

What they can no longer do, e.g. "Edit 4 projects".

string[]—
owned

What they own that would be left without an owner.

OwnedItem[][]
assignees

People who can take over owned items.

Assignee[][]
sessions

Sessions that end when access is revoked.

ActiveSession[][]
integrations

Integrations affected by the removal.

AffectedIntegration[][]
value

Controlled reassignment.

Reassignment—
defaultValue

Starting reassignments when uncontrolled.

Reassignment{}
onValueChange

Called with the reassignment after every change.

(value: Reassignment) => void—
liveWithin

Sessions active more recently than this (ms) are flagged as in use.

number15 * 60_000
onConfirm* (required)

Runs with the final reassignment. Return a promise to show a pending state; a rejection is caught.

(reassign: Reassignment) => void | Promise<void>—
onCancel

Called when the user cancels.

() => void—
suggestedAssigneeId

Who "Give all to" offers, e.g. their manager. Defaults to the first assignee.

string—
messages

Override headings and other small strings (see `REVOKE_MESSAGES`).

Partial<RevokeMessages>—
title

Heading, given the person's name.

(name: string) => React.ReactNode(n) => `Remove ${n}?`
confirmLabel

Confirm label, given the name and how many items stay unowned.

(name: string, orphaned: number) => string(n, orphaned) => (orphaned > 0 ? `Remove and leave ${orph…
pendingLabel

Confirm label while onConfirm runs.

string"Removing…"
cancelLabel

Label of the Cancel button.

string"Cancel"
unownedLabel

Picker option for leaving an item unowned.

string"No owner"
orphanText

Warning for the number of unowned items.

(count: number) => string(count) => `${count} ${count === 1 ? "item" : "items"} wi…
reassignAllLabel

Label of the reassign-all fix, given the assignee.

(assignee: string) => string(assignee) => `Give all to ${assignee}`

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

Accessibility

  • Section labelled by its title; each owned item's picker has a <label>
  • Unowned warning in a polite live region with a one-tap fix
  • Stops/keeps-running stated as text, not colour alone
  • Confirm sets aria-busy while pending; motion skipped under reduced motion

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

Limitations

This is a UX guard rail. Enforce on the server: Revoke tokens and sessions server-side, re-check authorization on the removal, and reassign ownership in the same transaction.

  • Only knows the owned items, sessions and integrations you pass
  • Does not revoke anything; onConfirm receives the reassignment

What it stops

Removed member's integrations stopped working

Also known as

remove member · offboarding · revoke access · api token · oauth app · team members · reassign · workspace members

Dependencies

Pairs well with