Non-managers who open /manager land on a broken 404 page #44

Open
opened 2026-10-03 19:44:39 +00:00 by jalenluorion · 0 comments
Member

What's wrong
A signed-in user without a manager or admin role who opens /manager is sent to /unauthorized, which does not exist, so Next's default 404 page shows. That page's built-in styles recolor the whole body (black background, white text), so the navbar's "Connect Google Calendar" button turns white on white.

How to reproduce

  1. Sign in as a normal user (no manager or admin role).
  2. Open /manager.
  3. You end up on /unauthorized with "404 This page could not be found."
  4. Look at "Connect Google Calendar" in the navbar: the text is invisible.

Expected
Non-managers land on a real page (a short "You don't have access" page, or /). Any unknown URL shows a CMUCal-styled not-found page that leaves the navbar readable.

Where to look

  • web/src/app/utils/redirect.ts: both hooks push /unauthorized. useRoleRedirect is unused and can be deleted.
  • web/src/app/: there is no unauthorized/page.tsx and no not-found.tsx (see the Next.js docs for not-found.js).
  • web/src/__tests__/manager.page.test.tsx: "redirects when user is user" expects /unauthorized; update it if the target changes.
  • The "Manager page can hang on a skeleton or flash for non-managers" issue also edits redirect.ts; coordinate.

Done when

  • /manager as a normal user ends on a real page.
  • A made-up path such as /does-not-exist shows a styled not-found page; the navbar stays readable in light and dark mode.
  • npm test passes in web/.
**What's wrong** A signed-in user without a manager or admin role who opens /manager is sent to /unauthorized, which does not exist, so Next's default 404 page shows. That page's built-in styles recolor the whole body (black background, white text), so the navbar's "Connect Google Calendar" button turns white on white. **How to reproduce** 1. Sign in as a normal user (no manager or admin role). 2. Open /manager. 3. You end up on /unauthorized with "404 This page could not be found." 4. Look at "Connect Google Calendar" in the navbar: the text is invisible. **Expected** Non-managers land on a real page (a short "You don't have access" page, or `/`). Any unknown URL shows a CMUCal-styled not-found page that leaves the navbar readable. **Where to look** - `web/src/app/utils/redirect.ts`: both hooks push `/unauthorized`. `useRoleRedirect` is unused and can be deleted. - `web/src/app/`: there is no `unauthorized/page.tsx` and no `not-found.tsx` (see the Next.js docs for `not-found.js`). - `web/src/__tests__/manager.page.test.tsx`: "redirects when user is user" expects `/unauthorized`; update it if the target changes. - The "Manager page can hang on a skeleton or flash for non-managers" issue also edits `redirect.ts`; coordinate. **Done when** - [ ] /manager as a normal user ends on a real page. - [ ] A made-up path such as /does-not-exist shows a styled not-found page; the navbar stays readable in light and dark mode. - [ ] `npm test` passes in `web/`.
jalenluorion added this to the Phase 1 milestone 2026-10-03 19:44:39 +00:00
jalenluorion added this to the CMUCal project 2026-10-03 19:45:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/cal#44
No description provided.