fix(backend): resolve shift signup by looking up Member via ExternalUserId #3

Merged
MasterMito merged 7 commits from fix/shift-signup-external-user-lookup into main 2026-03-09 15:56:12 +01:00
Owner

Summary

  • Root cause: Shift signup/cancel endpoints passed the Keycloak sub JWT claim (external UUID) directly as MemberId, but ShiftSignup.MemberId references the internal Member.Id — a different value.
  • Fix: ShiftService.SignUpForShiftAsync and CancelSignupAsync now accept string externalUserId, look up the Member by ExternalUserId + TenantId, and use the resolved internal Member.Id.
  • Tests: All 6 signup/cancel integration tests updated to seed proper Member + Club entities via SeedMemberAsync. All 13 tests pass.

Files Changed

File Change
ShiftService.cs Accept string externalUserId, resolve to internal Member.Id
ShiftEndpoints.cs Pass JWT sub as string, handle "Member not found" → 404
ShiftCrudTests.cs Seed Member records in all signup/cancel tests

Testing

  • dotnet build — 0 errors
  • dotnet test --filter ShiftCrudTests — 13/13 passed
## Summary - **Root cause**: Shift signup/cancel endpoints passed the Keycloak `sub` JWT claim (external UUID) directly as `MemberId`, but `ShiftSignup.MemberId` references the internal `Member.Id` — a different value. - **Fix**: `ShiftService.SignUpForShiftAsync` and `CancelSignupAsync` now accept `string externalUserId`, look up the `Member` by `ExternalUserId + TenantId`, and use the resolved internal `Member.Id`. - **Tests**: All 6 signup/cancel integration tests updated to seed proper `Member` + `Club` entities via `SeedMemberAsync`. All 13 tests pass. ## Files Changed | File | Change | |---|---| | `ShiftService.cs` | Accept `string externalUserId`, resolve to internal `Member.Id` | | `ShiftEndpoints.cs` | Pass JWT `sub` as string, handle "Member not found" → 404 | | `ShiftCrudTests.cs` | Seed `Member` records in all signup/cancel tests | ## Testing - `dotnet build` — 0 errors - `dotnet test --filter ShiftCrudTests` — 13/13 passed
MasterMito added 1 commit 2026-03-09 13:26:26 +01:00
fix(backend): resolve shift signup by looking up Member via ExternalUserId
All checks were successful
CI Pipeline / Backend Build & Test (pull_request) Successful in 52s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 29s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 5s
a8730245b2
The signup/cancel endpoints were passing the Keycloak sub claim (external UUID)
directly as MemberId, but ShiftSignup.MemberId references the internal Member.Id.
Now ShiftService resolves ExternalUserId to the internal Member.Id before creating
the signup record. Integration tests updated to seed proper Member entities.
MasterMito added 1 commit 2026-03-09 14:21:10 +01:00
fix(auth): resolve Keycloak OIDC issuer mismatch and API proxy routing
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Successful in 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Failing after 26s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
1322def2ea
- Bypass NextAuth OIDC discovery with explicit token/userinfo endpoints using internal Docker DNS, avoiding 'issuer string did not match' errors.
- Fix next.config.ts API route interception that incorrectly forwarded NextAuth routes to backend by using 'fallback' rewrites.
- Add 'Use different credentials' button to login page and AuthGuard for clearing stale sessions.
MasterMito added 1 commit 2026-03-09 14:25:18 +01:00
fix(frontend): remove invalid json parsing on shift signup
All checks were successful
CI Pipeline / Backend Build & Test (pull_request) Successful in 53s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 27s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 3s
6119506bd3
- Backend `/signup` endpoint returns 200 OK with an empty body (`TypedResults.Ok()`), causing `res.json()` to throw 'Unexpected end of JSON input'. Removed the `res.json()` return.
- Added Suspense boundary in login page to fix `useSearchParams` build error.
MasterMito added 1 commit 2026-03-09 14:46:45 +01:00
fix(shifts): expose ExternalUserId in ShiftSignupDto to fix frontend signup state
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Failing after 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 29s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 3s
867dc717cc
MasterMito added 1 commit 2026-03-09 15:06:11 +01:00
chore: commit sisyphus evidence and CI/CD artifacts
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Failing after 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 28s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
271b3c189c
MasterMito added 1 commit 2026-03-09 15:47:59 +01:00
Fix task and shift self-assignment features
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Successful in 48s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Failing after 28s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
672dec5f21
MasterMito added 1 commit 2026-03-09 15:53:40 +01:00
Fix TaskListItemDto missing title/status properties
All checks were successful
CI Pipeline / Backend Build & Test (pull_request) Successful in 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 30s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 3s
e0790e9132
MasterMito merged commit c6981324d6 into main 2026-03-09 15:56:12 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MasterMito/work-club-manager#3