feat: bearer auth, auto-sync events, test seed

- Add bearer plugin to BetterAuth for mobile auth
- Auto-sync birthday/anniversary events on client create/update
- Add /api/events/sync-all endpoint for bulk sync
- Add test user seed (test@test.com / test)
- Expose set-auth-token header in CORS
This commit is contained in:
2026-01-27 22:12:33 +00:00
parent f9643235be
commit 7bd506463e
8 changed files with 206 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
import { betterAuth } from 'better-auth';
import { bearer } from 'better-auth/plugins';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { db } from '../db';
import * as schema from '../db/schema';
@@ -13,6 +14,9 @@ export const auth = betterAuth({
verification: schema.verifications,
},
}),
plugins: [
bearer(), // Enable bearer token auth for mobile apps
],
emailAndPassword: {
enabled: true,
requireEmailVerification: false, // Enable later for production