Files
stack/packages/auth/package.json
Jason Woltje d03f78ae17 feat(auth): @mosaic/auth — BetterAuth email/password setup
Implements P0-004: authentication package with BetterAuth + Drizzle adapter.

- BetterAuth configured with Drizzle adapter (usePlural for table mapping)
- Email/password authentication enabled
- Role field (admin/member/viewer) as additional user field
- 7-day sessions with daily refresh
- Mounted at /api/auth/* basePath
- createAuth() factory takes Db instance for DI flexibility
- BETTER_AUTH_SECRET and BETTER_AUTH_URL env vars added to .env.example

Verified: auth instance created, handler and API methods confirmed.

Closes #4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:20:42 -05:00

30 lines
576 B
JSON

{
"name": "@mosaic/auth",
"version": "0.0.0",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"devDependencies": {
"@types/node": "^22.0.0",
"tsx": "^4.0.0",
"typescript": "^5.8.0",
"vitest": "^2.0.0"
},
"dependencies": {
"@mosaic/db": "workspace:^",
"better-auth": "^1.5.5"
}
}