Skip to content

Authentication, JWT & OTP

Auth collections (such as the built-in users collection) expose a full suite of authentication endpoints automatically.

Method Endpoint Purpose
POST /api/collections/users/records Register a new user
POST /api/collections/users/auth-with-password Login with email/password → returns JWT + record
POST /api/collections/users/auth-refresh Refresh JWT token
POST /api/collections/users/request-otp Request a one-time login code
POST /api/collections/users/auth-with-otp Verify OTP (brute-force attempt limited)
POST /api/collections/users/request-password-reset Request password reset email
POST /api/collections/users/confirm-password-reset Confirm new password
POST /api/collections/users/request-verification Send email verification link
POST /api/collections/users/impersonate/:id Impersonate user (Superuser only)

Every issued JWT embeds a fingerprint of the account’s token_key (for users) or password_hash (for superusers). Changing a password or rotating token_key immediately invalidates all previously issued tokens.