mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-19 11:24:57 -05:00
1.7.0 made both methods required on CustomAdapter and removed the factory fallback, so a custom adapter written for 1.6 type-checks against nothing and throws at request time on the first OTP, magic link, password reset, or two-factor attempt. Restore the fallbacks. consumeOne without a native implementation runs findOne then an id-guarded deleteMany and wins only when exactly one row was deleted. incrementOne runs a bounded compare-and-swap loop: findOne, then updateMany guarded on the id and the counter values just read, retried when a concurrent writer changed the row first. Both are single guarded statements per attempt, so they stay atomic across processes without transactions.
Better Auth Core
Core utilities and types for Better Auth — the most comprehensive authentication framework for TypeScript.
Installation
npm install @better-auth/core
Documentation
For full documentation, visit better-auth.com.
License
MIT