fuomag9
3a16d6e9b1
Replace next-auth with Better Auth, migrate DB columns to camelCase
...
- Replace next-auth v5 beta with better-auth v1.6.2 (stable releases)
- Add multi-provider OAuth support with admin UI configuration
- New oauthProviders table with encrypted secrets (AES-256-GCM)
- Env var bootstrap (OAUTH_*) syncs to DB, UI-created providers fully editable
- OAuth provider REST API: GET/POST/PUT/DELETE /api/v1/oauth-providers
- Settings page "Authentication Providers" section for admin management
- Account linking uses new accounts table (multi-provider per user)
- Username plugin for credentials sign-in (replaces email@localhost pattern)
- bcrypt password compatibility (existing hashes work)
- Database-backed sessions via Kysely adapter (bun:sqlite direct)
- Configurable rate limiting via AUTH_RATE_LIMIT_* env vars
- All DB columns migrated from snake_case to camelCase
- All TypeScript types/models migrated to camelCase properties
- Removed casing: "snake_case" from Drizzle config
- Callback URL format: {baseUrl}/api/auth/oauth2/callback/{providerId}
- package-lock.json removed and gitignored (using bun.lock)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-12 21:11:48 +02:00
fuomag9
77e354cd7c
feat: rewrite auth pages with shadcn
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-22 13:29:55 +01:00
fuomag9
73c90894b1
Handle wildcard proxy hosts and stabilize test coverage
...
- accept wildcard proxy host domains like *.example.com with validation and normalization
- make exact hosts win over overlapping wildcards in generated routes and TLS policies
- add unit coverage for host-pattern priority and wildcard domain handling
- add a single test:all entry point and clean up lint/typecheck issues so the suite runs cleanly
- run mobile layout Playwright checks under both chromium and mobile-iphone
2026-03-14 01:03:34 +01:00
fuomag9
75044c8d9b
fix: harden security post-review (JWT exposure, rate limiter, token expiry, timing)
...
- Raw JWT never sent to browser: page.tsx uses peekLinkingToken (read-only),
client sends opaque linkingId, API calls retrieveLinkingToken server-side
- link-account rate limiter now uses isRateLimited/registerFailedAttempt/
resetAttempts correctly (count only failures, reset on success)
- linking_tokens gains expiresAt column (indexed) + opportunistic expiry
purge on insert to prevent unbounded table growth
- secureTokenCompare fixed: pad+slice to expected length so timing is
constant regardless of submitted token length (no length leak)
- autoLinkOAuth uses config.oauth.allowAutoLinking (boolean) instead of
process.env truthy check that mishandles OAUTH_ALLOW_AUTO_LINKING=false
- Add Permissions-Policy header; restore X-Frame-Options for legacy UAs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-02-25 20:58:21 +01:00
fuomag9
be21f46ad5
Added user tab and oauth2, streamlined readme
2025-12-28 15:14:56 +01:00