Adjusted the `BETTER_AUTH_URL` in `.env.example` to emphasize its importance for proper functioning, especially for local development. Updated the catch-all handler in `apps/api/app/api/auth/[...all]/route.ts` to directly use the `auth.handler` from `better-auth`, simplifying the configuration. Corrected the file path for the TypeScript route definitions in `apps/api/next-env.d.ts`. In the iOS app, updated the API endpoints called for passkey sign-in and registration in `AppState.swift` to include the `/api` prefix, ensuring they match the backend routes. Refactored `SignInView.swift` to provide a cleaner and more intuitive user experience: - Introduced a toggle (`usePasskey`) to switch between passkey and email/password authentication. - Redesigned the UI with distinct sections for each authentication method. - Enhanced the email and password form with better styling and validation feedback. - Added a "Continue" button for email/password sign-in and "Continue with Passkey" for passkey authentication. - Modified the `authenticate` and `authenticateWithPasskey` functions to correctly invoke the `AppState` methods. Updated `SignUpView.swift` to use the `authenticate` method for consistency, which handles both sign-up and sign-in flows.
16 lines
524 B
Text
16 lines
524 B
Text
# Database
|
|
DATABASE_URL=postgresql://user:password@localhost:5432/shop
|
|
|
|
# Better Auth
|
|
# IMPORTANT: BETTER_AUTH_URL must match the actual server URL or auth will return 404
|
|
# For VPS: use the actual domain (e.g., https://api.bagsy.frg.network)
|
|
# For local: use http://localhost:3001
|
|
BETTER_AUTH_SECRET=your-secret-key-here-at-least-32-characters
|
|
BETTER_AUTH_URL=http://localhost:3001
|
|
|
|
# AI (OpenRouter)
|
|
OPENROUTER_API_KEY=your-openrouter-api-key-here
|
|
|
|
# Next.js
|
|
NEXT_PUBLIC_APP_URL=http://localhost:3001
|
|
NODE_ENV=development
|