fix(GRO-1236): OAuth callback session not established for uat-tester #403

Merged
groombook-engineer[bot] merged 1 commits from flea-flicker/gro-1236-oauth-callback-fix into dev 2026-05-14 19:25:37 +00:00

1 Commits

Author SHA1 Message Date
Chris Farhood 14098ec502 fix(GRO-1236): set VITE_API_URL and use /admin as OAuth callback URL
Two root causes fixed:
1. VITE_API_URL was empty in .env.production, so Better-Auth's client
   had no baseURL and could not correctly route the OAuth callback.
2. OAuth callbackURL was window.location.origin (root path), causing
   Better-Auth to redirect to / instead of /admin after login — since
   unauthenticated users at / are redirected to /login, this created a
   loop that appeared as 'session not persisting.'

With VITE_API_URL=https://uat.groombook.dev and callbackURL=/admin,
the callback lands on /admin which renders the admin layout and
correctly establishes the session cookie.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 19:25:16 +00:00