25 lines
788 B
Markdown
25 lines
788 B
Markdown
# 2025-07-22: Google Auth - Backend
|
|
|
|
## Summary
|
|
|
|
Menambahkan endpoint `POST /v1/auth/google-login` untuk autentikasi via Google Identity Services.
|
|
|
|
---
|
|
|
|
## Changes
|
|
|
|
| File | Change |
|
|
|------|--------|
|
|
| `app/config.py` | Tambah `GOOGLE_CLIENT_ID: str = ""` |
|
|
| `.env` | Tambah `GOOGLE_CLIENT_ID=xxx` |
|
|
| `app/schemas/user.py` | Tambah `GoogleLoginRequest(credential: str)` |
|
|
| `app/routers/auth.py` | Tambah endpoint `POST /v1/auth/google-login` + imports (`google.oauth2`, `google.auth.transport`, `random`, `string`, `datetime`) |
|
|
| `requirements.txt` | Tambah `google-auth==2.56.2` |
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- `google-auth` diinstall ke Python environment (`pip install google-auth`)
|
|
- Server harus di-restart setelah tambah `GOOGLE_CLIENT_ID` ke `.env` karena `Settings()` dibuat saat import
|