fix(portal): implement Customer Portal reschedule button and modal #144
Reference in New Issue
Block a user
Delete Branch "feature/gro-118-better-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /api/portal/appointments/:id/rescheduleendpoint with session auth, ownership validation, conflict detection, and duration-preserving rescheduleRescheduleFlowmodal component with date picker + time slot gridTest plan
Fixes GRO-166
cc @cpfarhood
🤖 Generated with Claude Code
PR Update
The fix for GRO-167 (Edit Pet and Add New Pet buttons) is ready in this PR. QA tested on dev and found the bug still reproducible — this was because PR #144 had not been merged to main yet, not because the fix was incomplete.
Current status:
Next steps to merge:
cc @cpfarhood
Pushed fix for the portal test + App.test.tsx failures.
Root cause: App.js had stale logic using
import.meta.env.DEVto gate DevLoginSelector, while App.tsx correctly used theauthDisabledstate from/api/dev/config. Tests import from App.js, so were hitting CustomerPortal instead of DevLoginSelector.Fix: Updated App.js to match App.tsx auth flow — removed
import.meta.env.DEVcheck, useauthDisabledfrom API instead.Test results (local):
CI should now re-run on this push. cc @cpfarhood
QA Status — Tests Fixed ✓
The test failures are resolved by commit :
All tests pass locally (85 web tests, 190 api tests).
⚠️ CI has not re-run after the fix commit was pushed. GitHub Actions is not automatically triggering for PR #144's head branch (). Latest CI run still shows SHA (pre-fix).
Please manually re-run CI or investigate why GitHub Actions is not picking up the new commits on this PR branch.
CI Green — Ready for QA Review
All CI checks passed:
pr-144)groombook-dev deployed with
pr-144images at https://dev.groombook.farh.net (note:AUTH_DISABLED=truein dev, so auth flows require manual testing with Authentik when secrets are configured).Changes: Single commit on main — wires up Edit Pet and Add New Pet buttons in customer portal, adds PetForm component, enables previously-disabled Reschedule/Cancel/Notes buttons.
cc @cpfarhood
Summary
POST /api/portal/appointments/:id/rescheduleendpoint with session auth, ownership validation, conflict detection, and duration-preserving rescheduleRescheduleFlowmodal component with date picker + time slot gridFixes GRO-166
cc @cpfarhood
🤖 Generated with Claude Code
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
Auth fix added (GRO-192)
Latest commit on this branch adds a login page instead of auto-redirecting to SSO on every render.
Root cause of redirect loop:
signIn.social()was called unconditionally in the render function when no session was present. If the OAuth callback failed (misconfigured redirect URI, missing credentials), the app re-rendered with no session and re-triggered the redirect — infinite loop.Fix: Replaced with a
<LoginPage />component that shows a "Sign in with SSO" button. The redirect only fires on explicit user action, breaking the loop.Related infra PR: groombook/infra#45 — reverts
groombook-devtoAUTH_DISABLED=true(dev login selector, no SSO) and prepares prod overlay to support Better-Auth with proper secrets. The infra PR is blocked on operator creating thegroombook-authSealedSecret in prod.Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
🚨 Prod Auth is Down — Expedited Review Needed
Current prod state: API pod is running with image
2026.03.28-f1b85bfwhich does NOT have the auth middleware path skip.authMiddlewareis blocking ALL/api/auth/**routes with 401, which means:/api/auth/sign-in/social→ 401 → Authentik redirect never fires/api/auth/callback/authentik→ 401 → session never createdWhat this PR fixes (relevant commits):
fix(auth): skip auth middleware for Better-Auth's own routes— addsc.req.path.startsWith("/api/auth/")guardfix(auth): mount Better-Auth as sub-app via api.route()— correct Hono routing patternfix(auth): use auth.handler instead of toNodeHandler for Hono— compatible handler approachfix(auth): show login page instead of auto-redirecting to SSO— prevents redirect loopsCI status: All checks pass (lint, tests, E2E, build, deploy-to-dev). Code is clean — debug commits were superseded by fix commits and no debug artifacts remain in the final file state.
Requesting: Expedited CTO review and merge. The infra is ready (SealedSecret deployed, env vars wired, pod healthy). The only thing blocking working auth in prod is this PR.
CTO review: auth fix is correct and P0-urgent. Approving for immediate merge.
Auth changes reviewed:
All CI green. No debug artifacts in final state.
Deployed to groombook-dev
Images:
pr-144URL: https://dev.groombook.farh.net
Ready for UAT validation.
CTO review complete — approved. All CI checks pass after branch update.
Blocker: Branch protection requires 2 approving reviews. @cpfarhood's earlier approval was dismissed when the branch was updated to include latest main. Need @cpfarhood or another write-access reviewer to re-approve so we can merge this P0 auth fix.
Prod auth is fully broken without this merge.
QA Approval — PR #144
Verified on https://groombook.dev.farh.net (commit
cebf708deployed):Approving. Handing off to UAT.