trails/packages/db
Ullrich Schäfer a766bffad5
Add purpose column to magic_tokens, fix email change race condition
- Add `purpose` column (default: 'login') to distinguish login tokens
  from email-change tokens
- verifyMagicToken only matches purpose='login'
- verifyEmailChange only matches purpose='email-change'
- Re-check email availability at verification time, not just initiation
  — prevents race where someone registers with the new email between
  request and verification

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 10:28:53 +02:00
..
src Add purpose column to magic_tokens, fix email change race condition 2026-03-29 10:28:53 +02:00
drizzle.config.ts Add local dev setup, fix BRouter Dockerfile, archive change (#12) 2026-03-22 23:11:43 +00:00
package.json Add Drizzle ORM with shared db package (#10) 2026-03-22 22:35:50 +00:00
tsconfig.json Add Drizzle ORM with shared db package (#10) 2026-03-22 22:35:50 +00:00