food-market/src/food-market.api
nurdotnet 05553bdc3d fix(moysklad): trailing slash on BaseUrl so HttpClient keeps /1.2/ in path
Logs showed every outbound MoySklad call was hitting
  https://api.moysklad.ru/api/remap/entity/organization
instead of the intended
  https://api.moysklad.ru/api/remap/1.2/entity/organization

Cause: per RFC 3986 §5.3, when HttpClient resolves a relative URI against
a base URI whose path does not end with '/', the last segment of the base
path is discarded. So BaseAddress "…/api/remap/1.2" + relative "entity/…"
produced "…/api/remap/entity/…". MoySklad returned 503 and we translated
it into a useless "401 сессия истекла" for the user.

Fixes:
- Append trailing slash to BaseUrl.
- Surface the real upstream status + body: MoySkladApiResult<T> wrapper,
  and the controller now maps 401/403 → "invalid token", 502/503 →
  "MoySklad unavailable", anything else → "MoySklad returned {code}: {body}".
  No more lying-as-401.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 23:26:32 +05:00
..
Controllers fix(moysklad): trailing slash on BaseUrl so HttpClient keeps /1.2/ in path 2026-04-21 23:26:32 +05:00
Infrastructure/Tenancy Phase 0: project scaffolding and end-to-end auth 2026-04-21 13:59:13 +05:00
Properties fix: pin API dev port to 5081 (match Vite proxy config) 2026-04-21 15:37:05 +05:00
Seed phase1d: demo catalog seeder (35 products, 8 groups, 2 suppliers) + product edit form 2026-04-21 20:38:23 +05:00
appsettings.Development.json Phase 0: project scaffolding and end-to-end auth 2026-04-21 13:59:13 +05:00
appsettings.json Phase 0: project scaffolding and end-to-end auth 2026-04-21 13:59:13 +05:00
food-market.api.csproj Phase 0: project scaffolding and end-to-end auth 2026-04-21 13:59:13 +05:00
Program.cs fix(auth): MoySklad admin endpoint uses policy-based auth on role claim directly 2026-04-21 23:18:27 +05:00