Repository navigation
@checodo/better-auth-waitlist@0.4.0
·
18 commits
to main
since this release
Minor Changes
-
01f3d0b: Record when an email was confirmed, and clean up expired entries on a schedule.
- New
confirmedAtfield onwaitlistEntry: when the person opened the confirmation link (double opt-in). It staysnullwhen nobody confirmed the email: withconfirmEmail: false, for emails an admin invited directly before they confirmed, and for entries confirmed before this release. - With the audit log, confirmations (
waitlist.confirmed) and people leaving through the link (waitlist.left) are recorded, both with severitylowand no actor.waitlist.leftandwaitlist.entry-deletedare recorded once, also when the same entry is deleted by concurrent requests. - Expired unconfirmed entries are now also deleted in the background on any waitlist request (at most once an hour), not only when someone joins. New server-only
auth.api.deleteExpiredWaitlistEntries()for a cron job, returning{ deleted }. - New
retentionoption:{ rejected, registered }deletes rejected and registered entries after that many days (kept by default), andsweepIntervalsets how often the cleanup runs (seconds, default3600).
Migration required:
confirmedAtis a new optional column. Runnpx auth@latest migrate(orgeneratefor Prisma and Drizzle); existing rows getnull. - New
Patch Changes
-
50f8e3f: Fix two rare outcomes of confirming an email at the same moment as something else changes the entry, and refuse durations no date can hold.
- A confirmation that finds the waitlist over
maxEntrieswhile an admin has just approved or rejected the same entry no longer answersWAITLIST_FULL: the confirmation stands, keeps itsconfirmedAt, and is recorded aswaitlist.confirmed. - A confirmation link whose entry is deleted while it is being confirmed (its link expired and the cleanup removed it) now answers
INVALID_TOKENinstead ofsuccess. confirmationExpiresIn,retention.rejected, andretention.registeredmust be at most 100 years (36,500 days). Larger values put the cleanup's cutoff outside the range of a date, so every cleanup failed.
- A confirmation that finds the waitlist over