Skip to content

feat(frontend): align KYC service with API gateway and JWT auth

Benabbes Walid a demandé de fusionner feat/frontend-connect-dashboard-auth-jwt vers develop

Updates kycService so investor KYC requests follow the same pattern as the dashboard: API gateway base URL and Authorization: Bearer using the stored access token (authStorage).

Changes

  • Base URL: default to VITE_API_BASE_URL (gateway); optional override with VITE_KYC_BASE_URL for direct KYC service in dev.
  • Headers: central buildFetchInit adds Accept, Content-Type for JSON bodies, and Authorization: Bearer <token> when present.
  • User identity: decode JWT payload for sub / userId / user_id to populate CreateKycRequestDto.userId; fallback to existing local/mock user id when no token.
  • Queries: omit userId on GET .../kyc and GET .../status when a bearer token exists so the backend resolves the user from the JWT (Keycloak sub).

Rapports de requête de fusion