fix(web): admin page role check — stop false redirect to /chat #203

Merged
jason.woltje merged 1 commits from fix/admin-redirect into main 2026-03-17 02:38:26 +00:00
Owner

Admin page was redirecting all users to /chat because the role check was failing. Fixes #196.

Admin page was redirecting all users to /chat because the role check was failing. Fixes #196.
jason.woltje added 1 commit 2026-03-17 02:38:20 +00:00
fix(web): admin page role check — stop false redirect to /chat
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
df4b7399ad
The admin page role check was failing because better-auth v1.5.5 doesn't
automatically include additionalFields (like 'role') in the session response.
This caused the admin guard to treat all users as non-admin and redirect them.

The fix implements a defensive fallback in the AdminGuard that fetches the
role from the database if it's missing from the session, ensuring that admin
users can access the admin panel while protecting against regression.

Fixes #196
jason.woltje merged commit bf668e18f1 into main 2026-03-17 02:38:26 +00: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: mosaicstack/stack#203