Commit Graph

7 Commits

Author SHA1 Message Date
Z User
f95821c08d Fix auth: validate tokens via Auth0 userinfo endpoint (supports opaque tokens) 2026-03-27 23:31:14 +00:00
Z User
67edb02b1f Fix Auth0 authentication: update auth routes with better logging and config handling 2026-03-27 23:25:13 +00:00
Z User
e0f37c1e52 Add dedicated auth routes for token exchange
- Create /api/auth routes for authentication
- Add POST /api/auth/token for code-to-token exchange
- Add GET /api/auth/callback for redirect-based flow
- Add GET /api/auth/config for frontend config
- Backend handles token exchange with client secret
- Works with Regular Web Application Auth0 type
2026-03-27 23:16:09 +00:00
Z User
e8919fc985 Fix Auth0 domain: add .us. region prefix 2026-03-27 22:55:25 +00:00
Z User
bbdbc0c1df Switch from sqlite3 to sql.js for cross-platform compatibility
- Replace sqlite3 (native) with sql.js (pure JS/WebAssembly)
- Fixes GLIBC version compatibility issues
- Rewrite database module for sql.js async API
- Add proper file persistence for sql.js (in-memory with save-to-file)
- Update server startup to initialize database before listening

sql.js works everywhere without native compilation
2026-03-27 22:38:36 +00:00
Z User
9b4d3242e2 Switch to Auth0 authentication
- Replace custom session-based auth with Auth0 JWT validation
- Add express-oauth2-jwt-bearer for token validation
- Update database schema to support Auth0 users (auth0_id, picture fields)
- Add Auth0 login/callback/logout endpoints
- Auto-create users on first Auth0 login
- Update user routes for Auth0 integration
- Add dotenv for environment configuration
- Update documentation with Auth0 setup instructions
2026-03-27 22:19:15 +00:00
Z User
55335f14e7 Initial commit: Express backend with user management and SQLite database
Features:
- Express server on port 9991 with ESM syntax
- User registration, login, and session management
- Password hashing with bcryptjs
- SQLite database with sqlite3 package
- User credits and transaction tracking
- API key management
- Admin endpoints for user management
- Stripe and PayPal webhook endpoints (ready for integration)
- Rate limiting and error handling
- CORS and security headers with helmet

Database tables:
- users (accounts, subscriptions, credits)
- sessions (auth tokens)
- api_keys (user API access)
- credit_transactions (credit history)
- payments (payment tracking)
2026-03-27 21:33:56 +00:00