Files
FitTrack_GarminSync/backend
sstent 3cf0a55130 fix: Resolve garminconnect login failure and implement garth MFA
This commit resolves the persistent `garminconnect` login failure caused by
changes in Garmin's SSO process. The authentication mechanism has been
refactored to primarily use the `garth` library for initial login and
Multi-Factor Authentication (MFA) handling, enhancing robustness and
adhering to the feature plan.

Key changes include:
- Refactored `_perform_login` in `backend/src/services/garmin_auth_service.py`
  to directly utilize `garth.Client().login()`, replacing the problematic
  `garminconnect.login()`.
- Updated `initial_login` to gracefully handle `garth`'s MFA exceptions,
  returning appropriate responses to guide the authentication flow.
- Added a new `complete_mfa_login` method to `backend/src/services/garmin_auth_service.py`
  for submitting MFA codes and finalizing the login process.
- Ensured `garminconnect` implicitly leverages the established `garth` session,
  eliminating redundant login attempts.
- Addressed static analysis issues by updating `typing` imports and
  suppressing `mypy` errors for `garth.Client` attributes where appropriate.
2025-12-22 06:11:12 -08:00
..