Error codes
Every APIError code the plugin can return.
Errors are Better Auth APIErrors carrying a code and a message:
import { INVITE_ERROR_CODES } from "@octopi-ai/better-enrollment";
| Code | When |
|---|
INVITE_NOT_FOUND | Unknown or no longer valid token |
INVITE_EXPIRED | The invite passed its expiresAt |
INVITE_REVOKED | The invite was revoked |
INVITE_ALREADY_USED | A single-use invite was already redeemed, or a public invite hit its use cap |
EMAIL_ALREADY_INVITED | A pending invite of the same kind (and, for org-join, the same org) already holds that address; resend it |
USER_ALREADY_EXISTS | app invite to an address that already has an established account |
| Code | When |
|---|
INVALID_ROLE | Role rejected at create |
ROLE_NO_LONGER_VALID | The invited role no longer exists at redeem |
ROLE_NOT_ALLOWED_FOR_ORG_JOIN | org-join invites cannot set an app role |
NOT_ALLOWED_TO_MANAGE_INVITES | Failed the admin gate |
| Code | When |
|---|
PASSWORD_NOT_AVAILABLE | A password was sent to a passwordless app |
EMAIL_MISMATCH | Open-mode activation guard: the emails do not match |
EMAIL_NOT_VERIFIED | Open-mode activation guard: the email is not verified |
USER_BANNED | Banned accounts cannot redeem |
NAME_REQUIRED | Sign-up redemption without a name |
ADDITIONAL_FIELD_REQUIRED | A required additional field is missing |
ADDITIONAL_FIELD_INVALID | An additional field failed its type check or validator |
| Code | When |
|---|
SEAT_LIMIT_REACHED | No seats left, at create or at redeem |
ORG_INVITE_NOT_ALLOWED | Not permitted to invite into that organization |
ORG_DISABLED | The organization is disabled |
ORG_SLUG_TAKEN | Slug collision while founding an organization |
Last updated on