Deactivate a user
Shut an account down completely — sessions, passes and all — and know what reactivation restores.
Owned by Admin · 8 steps · about 12 minutes
Why this exists
Deactivation is the platform's answer to "this person must stop being able to do things, now". It is deliberately one action with a wide blast radius rather than a checklist you might half-finish.
One call does four things in one transaction: the user row is soft-deleted so login is refused, every session is revoked immediately, the grants are left intact, and every live pass the person holds is revoked. That fourth part is the one people forget when they do this by hand. A pass never authenticates a session — it is a signed offline credential — so killing sessions alone would leave a banned account walking through doors all night. Revocation blacklists the serial, destroys the TOTP secret and pushes a wallet VOID so offline readers learn about it too.
Grants are kept on purpose. Deactivation is not a purge; it is a suspension you can undo, and throwing away the grant history would also throw away the audit story of what this person could do.
Pass revocation is terminal, which shapes reactivation: reactivating re-mints a membership card for someone who had one, but event ticket passes are not restored. Those must be re-issued from the ticket. And the final admin cannot be deactivated — 409 last_admin — for the same reason you cannot revoke the last admin grant.
The login failure a deactivated user sees is the ordinary invalid-credentials message. The platform does not say "your account is disabled", because that would let anyone enumerate account states from the login form.
Before you start
- An admin session.
- A target account that is not the last admin.
- Ideally a target that holds a live pass, so you can watch the door consequence.
- The seed also ships an already-deactivated account, dormant@demo.club, if you want to practise reactivation first.
Practise with
| Persona | Password | Note | |
|---|---|---|---|
| admin | admin@club.test | admin123 | runs the deactivation |
| member | freya@demo.club | freya-pass-123 | a live registered member — safe to deactivate and reactivate |
| door_staff | door@club.test | door123 | sees the revoked pass fail at the reader |
Steps 1–2 — Admin
their manual →-
1Open the user and read what you are about to switch off: their grants, their session count, and their audit history.Expected result The full picture, including whether they are one of very few admins.Watch out for Check the grant list for an admin grant before you go further. The last admin is protected, but the second-to-last is not.
-
2Deactivate, with a reason. Use the Deactivate button on the user page.Expected result The account is soft-deleted, every session is revoked, every live pass is revoked, and the audit row records how many passes went with it.Watch out for 409 last_admin protects the final admin, and the guard is evaluated inside the write transaction so concurrent attempts cannot both win. Nothing here is a soft warning: the moment it returns, they are out.
Steps 3 — Member
their manual →It is their account: they are the one who suddenly cannot log in, and they are told nothing.
-
3Try to log in as the deactivated account.Expected result The same invalid-credentials message you would get from a wrong password.Watch out for This is deliberate. If you are supporting a confused user, you must look them up in the admin console — the login page will never tell either of you that the account is disabled.
Steps 4 — Door Staff
their manual →The revoked credential fails at their reader and they must not mistake it for a broken scanner.
-
4Scan the deactivated person's membership card at a reader.Expected result Red, with a revoked reason. The serial is blacklisted and the rotating code no longer verifies.Watch out for Do not re-scan, do not try the QR instead of the tap, and do not wave them through. A revoked pass is revoked on every rail at once, including offline.
Steps 5–8 — Admin
their manual →-
5Find the user_deactivate row and read its detail: the reason you typed, and the number of passes revoked.Expected result One audit row, immutable.Watch out for If the passes-revoked count is zero and you expected otherwise, the person never held a live pass — that is information, not a failure.
-
6Learn the softer tool as well: revoking all sessions logs someone out everywhere without disabling the account.Expected result A count of revoked sessions and its own audit row.Watch out for Use this for 'they left a laptop on a train', not for 'they left the company'. It does not touch passes.
-
7Reactivate the account when the suspension ends.Expected result Login works again, the grants are still there, and a membership card is re-minted for someone who held one.Watch out for Event ticket passes do NOT come back. Pass revocation is terminal by design, so a reactivated ticket holder needs their ticket pass issued again from their tickets page.
-
8Confirm the end state: sessions, grants, and the fact that the revoked pass has not quietly returned.Expected result An identity dump consistent with what you intended.Watch out for Admin-only, and gone entirely when debug endpoints are off.