classroom
classroom copied to clipboard
Unauthorized access to the /classes page should show a more descriptive error message
Describe the bug When an unauthorized user (not a "TEACHER") clicks on the "classes" link, the app redirects to a blank page.
To Reproduce Steps to reproduce the behavior:
- Click "Sign in"
- Sign in with Github
- The app will redirect you back to the homepage
- On your terminal, run the command "npx prisma studio"
- In Prisma Studio, open the "User" table. Confirm that your user has a role of "NONE".
- Back on the homepage of the Classroom app, click on "Classes". The resulting page will be totally blank.
Expected behavior We should see a more descriptive error message that says "Access Denied". The browser should redirect to the /error page.
Screenshots
Current behavior (blank screen):
Expected behavior:
Additional context I am using Github Codespaces (Linux) to reproduce this issue.
We are reserving this issue for the CTI-CodeDay Micro-internship students.
This issue is reproducible without signing in either. Should both cases redirect to the error page?
If you were to change the menu button on the nav bar to send you to /admin instead, this same behavior occurs. Refreshing the page seems to get the redirect to work again for both /classes and /admin