Commit Graph

31 Commits

Author SHA1 Message Date
sdarbinyan
84253012c1 fix(auth): route admin/customer Telegram QR login to the shared auth origin
Some checks failed
Architecture Governance / architecture (push) Failing after 2m51s
Deploy Frontend / deploy (push) Failing after 1m57s
AUTH_API_URL was wired to ApiConfigService.getBaseUrl() (the per-tenant
content origin, e.g. api.gorbushka.market), so admin/customer QR-login
session creation POSTed to a host with no /users/sessions route.

Auth is a single shared cross-tenant service (like payment's
qr.vitanova.network), not tenant-scoped - confirmed against the
pre-tenant-refactor state (commit a59ffbca) where every brand's
environment file carried the identical fixed authApiUrl, and against a
live POST to users.vitanova.network:456/users/sessions.

Restores authApiUrl as a fixed constant in both environment files and
wires AUTH_API_URL/MARKETPLACES_AUTH_CONFIG.apiUrl to it, mirroring the
existing qrApiUrl/provideMarketplacesPayment pattern. Also provides
MARKETPLACES_AUTH_CONFIG.marketplaceDomain via TenantResolverService's
existing getBaseDomain() so the X-Marketplace-Domain header stays
normalized instead of falling back to raw, unnormalized
location.hostname (it was never provided before, so that fallback was
always in effect).

No package edits, no path/method/body change, no QR/Telegram flow
change. tenantApiTemplate/tenantApiBaseUrls/ApiConfigService/
TenantResolverService untouched - still drive content-API resolution
only.

Known remaining blocker (server-side, tracked in vitanovaPackages
BACKEND-TODO.md): users.vitanova.network:456 CORS-rejects the
admin.gorbushka.market origin outright (403 on preflight, no allow
headers) while novo.market gets a full grant - this fix alone will not
make browser login work on gorbushka domains until that origin
allowlist is updated.
2026-08-24 14:14:30 +04:00
9cd56586fb fix(api): share base-domain API host
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Tenant subdomains route through api.<base-domain>; nginx forwards the exact storefront host derived from the validated browser origin.
2026-08-20 16:12:37 +04:00
640360d63c fix(api): derive host from storefront domain
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Every storefront, including nested subdomains, uses its matching api.<hostname> endpoint.
2026-08-20 14:31:22 +04:00
f4ea4c7af8 fix(api): route tenants through origin gateway
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
2026-08-20 14:23:12 +04:00
sdarbinyan
fd5a436220 api doc
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
2026-07-20 01:02:36 +04:00
sdarbinyan
6aec2ebcb2 fix(admin-auth): reuse exact same QR/session API and component for admin login
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
- Removed invented adminAuthApiUrl endpoint and separate AdminLoginComponent.
  Admin login now uses the exact same Telegram session backend
  (TelegramSessionApiService, {authApiUrl}/users/sessions) and the exact
  same TelegramLoginComponent (mode="customer" | "admin" input) as customer
  login - only the storage (cookie/localStorage/signals) stays separate.
- Extracted the shared HTTP+normalization logic from AuthService into
  TelegramSessionApiService so both AuthService and AdminAuthService call it
  instead of duplicating request/parsing code.
- Documented the resulting backend gap in docs/Project-Editor.md: since the
  session API has no concept of "admin", server-side role enforcement is
  required when admin API calls are made - the frontend only decides where
  to store the session, not whether the user is actually an admin.
2026-07-14 10:13:59 +04:00
sdarbinyan
3877b70fdf feat(sprint18): editor autosave/reset, admin auth, QR reuse, Ed25519 prep
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
- Project editor: persist draft to localStorage, restore on reload,
  last-saved/draft-restored status indicators, section/whole-draft reset
  with confirmation.
- Extract shared QR/polling/expiry engine from TelegramLoginComponent
  (shared/qr-login) and reuse it for a new admin login flow.
- Admin authentication kept fully separate from customer session:
  own cookie/localStorage keys, signals, guard, and header interceptor
  (core/admin-auth).
- ?login=true / ?adminLogin=true open the respective login dialog for
  manual testing.
- Ed25519 challenge/verify interfaces (fail-closed no-op binding) ready
  for backend delivery.
- Document autosave/reset/admin-auth/QR-reuse/Ed25519 model and the
  remaining full-field-coverage gap in docs/Project-Editor.md.
2026-07-14 09:50:03 +04:00
sdarbinyan
145a13857d fix local bootstrap startup and catalog widget UX 2026-07-05 02:44:04 +04:00
sdarbinyan
487a3fb913 Sprint 9: add tenant-driven API resolution layer 2026-07-05 02:24:16 +04:00
sdarbinyan
9cf508d319 clean up 2026-07-05 00:57:20 +04:00
sdarbinyan
c4063e76de lovero 2026-07-02 02:22:00 +04:00
sdarbinyan
14bdd3bcd0 api change 2026-06-05 18:23:24 +04:00
sdarbinyan
1bec150822 Merge branch 'main' of https://sources.vitanova.network/sdarbinyan/marketplaces 2026-06-01 00:47:57 +04:00
sdarbinyan
4d8dc6b59c api auth 2026-06-01 00:47:26 +04:00
tonoyan
b0a744034b phone number and address 2026-05-28 12:56:41 +00:00
sdarbinyan
49f69f6af0 port 2026-05-19 03:53:23 +04:00
sdarbinyan
ea80f90d0f api 2026-05-19 03:20:25 +04:00
sdarbinyan
dd74432dd7 api 2026-05-19 03:14:12 +04:00
sdarbinyan
4aef4881e1 changes 2026-05-19 02:57:19 +04:00
sdarbinyan
cb2666177a lavero 2026-05-19 02:01:36 +04:00
sdarbinyan
a15f2bca6a dynamic phone and bots 2026-04-14 22:28:34 +04:00
sdarbinyan
7df15a4243 phone number 2026-04-14 13:48:56 +04:00
sdarbinyan
06a7568386 fixed novo market apis 2026-04-13 23:19:38 +04:00
sdarbinyan
77737f0ba9 fixing novo 2026-04-13 22:39:33 +04:00
sdarbinyan
650bf137f2 fixes 2026-03-24 02:25:50 +04:00
sdarbinyan
56f4c56b9e integration new apis 2026-03-24 00:09:11 +04:00
sdarbinyan
3445f55758 updates 2026-03-01 02:43:14 +04:00
sdarbinyan
377da22761 Merge branch 'auth-system' into back-office-integration 2026-02-28 17:37:14 +04:00
sdarbinyan
6689acbe57 created auth system 2026-02-28 17:18:24 +04:00
sdarbinyan
369af40f20 bo integration 2026-02-20 10:44:03 +04:00
sdarbinyan
bd80896886 very first commit 2026-01-18 18:57:06 +04:00