HeyPuter/puter · error · HttpError
account_suspended
account_suspended
Error message
Account is suspended
What it means
Raised in `refreshUser` when the fresh, cache-bypassed user row has `suspended` truthy. The userProtected chain re-reads the user specifically to catch accounts suspended after login, blocking them from sensitive operations.
Source
Thrown at src/backend/core/http/middleware/userProtected.ts:176
const refreshUser: RequestHandler = async (
req: Request,
_res: Response,
next: NextFunction,
) => {
const actor = req.actor;
if (!actor?.user?.id)
throw new HttpError(401, 'User required', {
legacyCode: 'unauthorized',
});
const user = await userStore.getByProperty('id', actor.user.id, {
force: true,
});
if (!user)
throw new HttpError(404, 'User not found', {
legacyCode: 'not_found',
});
if (user.suspended)
throw new HttpError(403, 'Account is suspended', {
legacyCode: 'account_suspended',
});
req.userProtected = { user };
next();
};
// 3. Password (bcrypt) OR valid OIDC revalidation cookie.
//
// - Temp users (no password + no email) pass only when the route was
// registered with `allowTempUsers: true` (delete-own-user).
// - `req.body.password` → bcrypt match against user row. OIDC-only
// accounts bounce with `oidc_revalidation_required` + a
// `revalidate_url` helper so the GUI can open the OIDC popup.
// - Otherwise accept a valid `puter_revalidation` cookie. Expiry,
// `purpose === 'revalidate'`, matching `user_uuid` all required.
// - Password account, neither credential → 403 `password_required`.
const verifyIdentity: RequestHandler = async (
req: Request,View on GitHub (pinned to 908ec23eda)
Solutions
- Contact support to resolve the suspension.
- As admin, clear the `suspended` flag once resolved.
- Force the user to re-authenticate after the flag is cleared.
Defensive patterns
Strategy: try-catch
Try / catch
try { await call(); }
catch (e) {
if (e.code === 'account_suspended') { showAccountSuspended(); return; }
throw e;
} Prevention
- Force re-authentication after an account is suspended.
- Clear the suspended flag only after the issue is resolved.
- Treat the cache-bypassing read as authoritative — don't trust stale cached rows.
When it happens
Trigger: An account is suspended by an admin or moderation system mid-session, then the user attempts a userProtected action (delete account, change password).
Common situations: Moderation action taken while the user is logged in; an automated abuse system suspended the account between login and the sensitive action.
Related errors
AI-assisted analysis of HeyPuter/puter@908ec23eda (2026-08-12).
Data as JSON: /api/errors/b50523906a85910b.
Report an issue: GitHub.