Skip to content

v0.7.0

Latest

Choose a tag to compare

@FalconiZzare FalconiZzare released this 24 Oct 01:00
31f6ef1

Org-create invites can now carry the organization they found, apps can add their own fields to it at founding time, and invite lists page with a stable cursor.

Features

  • organizations: POST /invite/create and createSystemInvite accept organization: { name, slug? } on org-create invites.
    • The inviter fixes the new organization's name, and the redeemer no longer types it.
    • GET /invite/get returns the preset name as organizationName and leaves organizationName/organizationSlug out of requiredFields, and redemption ignores org fields sent by the client.
    • A taken slug gets a short random suffix instead of failing, since the founder can't pick another one.
    • Delivery functions receive the preset name as organizationName, on create and resend.
    • See Preset organizations.
  • organizations: new organization.beforeOrgCreate({ invite, user, organization }) hook.
    • It runs on every org-create redemption. Fields it returns are merged into the new organization row, so apps can set their own additionalFields, for example a type or a parent organization.
    • Throwing an APIError aborts redemption. For private invites and signed-in activation the invite stays pending.
    • id, name, slug, createdAt, seatLimit and disabledAt always come from the plugin.
  • api: GET /invite/list takes an optional cursor and returns nextCursor, ordered createdAt desc, id desc with no gaps or duplicates across equal timestamps on every adapter. page keeps working when no cursor is sent.

Fixes

  • tests: a platform-controls test started its calls eagerly, which could surface a handled rejection as unhandled and fail the release run.

Compatibility

  • Tested against Better Auth 1.6 and 1.7. The minimum supported version stays at better-auth >= 1.4.0.

Migration notes

  • Schema: two new nullable columns on invite, presetOrganizationName and presetOrganizationSlug. Run your migration or db push.
  • Error code: INVALID_CURSOR (400) for a malformed list cursor.
  • No breaking changes: invites without a preset, apps without the hook, and lists paged with page behave exactly as before.

Full changelog: v0.6.0...v0.7.0