feat: integrate Google OAuth authentication provider and add login UI button
This commit is contained in:
19
AGENTS.md
19
AGENTS.md
@@ -88,7 +88,26 @@ Biome is used (not ESLint). Config in `biome.json`:
|
||||
- `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL` - Auth core
|
||||
- `APP_BASE_URL` - Frontend URL for trusted origins
|
||||
- `CORS_ORIGIN` - Frontend URL for CORS policy
|
||||
- `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` - Google OAuth (see below)
|
||||
|
||||
**Frontend** (`apps/frontend/.env`):
|
||||
- `VITE_*` prefix required (Vite embeds these at build time)
|
||||
- `VITE_API_BASE_URL` - Backend URL (default: http://localhost:3000)
|
||||
|
||||
## Google OAuth
|
||||
|
||||
To enable login with Google:
|
||||
|
||||
1. Create OAuth credentials in Google Cloud Console:
|
||||
- Application type: Web application
|
||||
- Authorized redirect URI: `{BETTER_AUTH_URL}/api/auth/callback/google`
|
||||
|
||||
2. Add env vars to `.env.example`:
|
||||
```
|
||||
GOOGLE_CLIENT_ID=your-google-client-id
|
||||
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
||||
```
|
||||
|
||||
3. The backend configures `socialProviders.google` automatically.
|
||||
|
||||
4. Frontend uses `authClient.signIn.social({ provider: 'google', callbackURL: 'http://localhost:5173' })`.
|
||||
|
||||
Reference in New Issue
Block a user