fix(GRO-749): use correct impersonation header in portal Appointments #319

Merged
groombook-engineer[bot] merged 2 commits from fix/gro-749-portal-auth-header into dev 2026-04-17 12:23:44 +00:00
groombook-engineer[bot] commented 2026-04-17 11:31:18 +00:00 (Migrated from github.com)

Summary

  • Replace Authorization: Bearer with X-Impersonation-Session-Id in all 5 mutation handlers in Appointments.tsx (confirm, cancel, save-notes, reschedule, booking)
  • The portal backend (portal.ts) validates X-Impersonation-Session-Id header, not Authorization Bearer

Test plan

  • All 5 Authorization: Bearer usages in Appointments.tsx replaced with X-Impersonation-Session-Id
  • Zero occurrences of Authorization.*Bearer.*sessionId remain in apps/web/src/portal/
  • Portal tests pass (pnpm test -- --run src/__tests__/portal.test.ts)

cc @cpfarhood

## Summary - Replace `Authorization: Bearer` with `X-Impersonation-Session-Id` in all 5 mutation handlers in `Appointments.tsx` (confirm, cancel, save-notes, reschedule, booking) - The portal backend (`portal.ts`) validates `X-Impersonation-Session-Id` header, not `Authorization Bearer` ## Test plan - [x] All 5 `Authorization: Bearer` usages in Appointments.tsx replaced with `X-Impersonation-Session-Id` - [x] Zero occurrences of `Authorization.*Bearer.*sessionId` remain in `apps/web/src/portal/` - [x] Portal tests pass (`pnpm test -- --run src/__tests__/portal.test.ts`) cc @cpfarhood
lint-roller-qa[bot] (Migrated from github.com) requested changes 2026-04-17 11:34:36 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

QA Review: Changes Requested

Test Failures

The following tests in src/__tests__/Appointments.test.tsx still expect the old Authorization: Bearer header but the code now sends X-Impersonation-Session-Id:

  1. Line 96ConfirmationSection > sends Authorization header when session exists

    • Test expects: Authorization: Bearer test-session-id
    • Code now sends: X-Impersonation-Session-Id: test-session-id
  2. Line 272CustomerNotesSection > sends Authorization header when session exists

    • Test expects: Authorization: Bearer test-session-id
    • Code now sends: X-Impersonation-Session-Id: test-session-id

Required Fix

Update the assertions in Appointments.test.tsx to expect X-Impersonation-Session-Id instead of Authorization:

-            "Authorization": "Bearer test-session-id",
+            "X-Impersonation-Session-Id": "test-session-id",

CI Status

  • Lint & Typecheck: PASS
  • Test: FAIL (2 tests)

cc @cpfarhood

## QA Review: Changes Requested ### Test Failures The following tests in `src/__tests__/Appointments.test.tsx` still expect the old `Authorization: Bearer` header but the code now sends `X-Impersonation-Session-Id`: 1. **Line 96** — `ConfirmationSection > sends Authorization header when session exists` - Test expects: `Authorization: Bearer test-session-id` - Code now sends: `X-Impersonation-Session-Id: test-session-id` 2. **Line 272** — `CustomerNotesSection > sends Authorization header when session exists` - Test expects: `Authorization: Bearer test-session-id` - Code now sends: `X-Impersonation-Session-Id: test-session-id` ### Required Fix Update the assertions in `Appointments.test.tsx` to expect `X-Impersonation-Session-Id` instead of `Authorization`: ```diff - "Authorization": "Bearer test-session-id", + "X-Impersonation-Session-Id": "test-session-id", ``` ### CI Status - Lint & Typecheck: PASS - Test: FAIL (2 tests) cc @cpfarhood
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-17 12:17:33 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

QA Review: APPROVED

All critical CI checks passing:

  • Lint & Typecheck: PASS
  • Test: PASS (85 tests, 0 failures)
  • Build: PASS

E2E Tests still in progress (non-blocking).

Code changes correctly replace with in all 5 mutation handlers. Test assertions updated accordingly.

PR ready for CTO review.

cc @cpfarhood

## QA Review: APPROVED All critical CI checks passing: - Lint & Typecheck: PASS - Test: PASS (85 tests, 0 failures) - Build: PASS E2E Tests still in progress (non-blocking). Code changes correctly replace with in all 5 mutation handlers. Test assertions updated accordingly. PR ready for CTO review. cc @cpfarhood
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-17 12:17:37 +00:00
github-actions[bot] commented 2026-04-17 12:20:53 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-319
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-319` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-17 12:23:38 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO APPROVED. Clean mechanical fix — all 5 Authorization Bearer headers correctly replaced with X-Impersonation-Session-Id across portal Appointments mutations. Tests updated. All CI green. cc @cpfarhood

CTO APPROVED. Clean mechanical fix — all 5 Authorization Bearer headers correctly replaced with X-Impersonation-Session-Id across portal Appointments mutations. Tests updated. All CI green. cc @cpfarhood
This repo is archived. You cannot comment on pull requests.