OutlabsAuth
Auth

User Status

Active, invited, suspended, banned, deleted.
What each user status means for login and admin flows.

Status answers one question: can this user authenticate?

StatusCan log in?Typical meaningHow it usually changes
activeYesNormal accountFrom invite accept; admin reactivate
invitedNoInvite sent; no password yetactive via accept-invite
suspendedNoTemporary blockAdmin PATCH …/status; optional suspended_until
bannedNoPermanent blockAdmin; rarely reversed
deletedNoSoft-deletedAdmin delete; restore via POST …/restore

Email verification, lockouts, and product policy live in other fields — do not overload status for those.

from outlabs_auth.models.sql.enums import UserStatus
# active | invited | suspended | banned | deleted

Behavior notes

  • Login checks status before password verification and raises an inactive / banned style error per status (invited users are pointed at the invite email).
  • Only active users authenticate (JWT, API keys, refresh), subject also to lockout (failed_login_attempts / locked_until) when that path is enabled.
  • On suspend / ban / delete, revoke refresh tokens (and API keys) in the same admin action if you need immediate cut-off; short-lived access JWTs may still work until expiry unless you enable Redis blacklist.
  • Admin status PATCH on the users router allows active | suspended | banned only — not deleted (use delete / restore endpoints). See 23.

ConcernFields / mechanism
Invite in flightinvite_token, invite_token_expires, invited_by_id
Soft deletedeleted_at
Timed suspendsuspended_until (host/auto-reactivation logic)
Brute-force lockfailed_login_attempts, locked_until
Email proofemail_verified (separate from status)