trails/apps/journal/app/lib
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
..
activities.server.ts Use explicit .ts extensions for Node-compatible imports 2026-03-25 01:34:16 +01:00
auth.server.ts Add purpose column to magic_tokens, fix email change race condition 2026-03-29 10:28:53 +02:00
db.ts Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00
email.server.test.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
email.server.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
jwt.server.ts Implement Planner-Journal handoff (Group 9) 2026-03-24 20:22:58 +00:00
logger.server.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
metrics.server.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
routes.server.ts Use explicit .ts extensions for Node-compatible imports 2026-03-25 01:34:16 +01:00