Non-managers who open /manager land on a broken 404 page #44
Labels
No labels
bug
chore
data
feature
frontend
good first issue
intermediate
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cal#44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
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
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.useRoleRedirectis unused and can be deleted.web/src/app/: there is nounauthorized/page.tsxand nonot-found.tsx(see the Next.js docs fornot-found.js).web/src/__tests__/manager.page.test.tsx: "redirects when user is user" expects/unauthorized; update it if the target changes.redirect.ts; coordinate.Done when
npm testpasses inweb/.