Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized access to the /classes page should show a more descriptive error message #497

Open
utsab opened this issue Oct 20, 2023 · 3 comments · May be fixed by #515
Open

Unauthorized access to the /classes page should show a more descriptive error message #497

utsab opened this issue Oct 20, 2023 · 3 comments · May be fixed by #515
Labels

Comments

@utsab
Copy link
Collaborator

utsab commented Oct 20, 2023

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:

  1. Click "Sign in"
  2. Sign in with Github
  3. The app will redirect you back to the homepage
  4. On your terminal, run the command "npx prisma studio"
  5. In Prisma Studio, open the "User" table. Confirm that your user has a role of "NONE".
  6. 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):
Screen Shot 2023-10-19 at 8 40 46 PM

Expected behavior:
Screen Shot 2023-10-19 at 8 40 25 PM

Additional context
I am using Github Codespaces (Linux) to reproduce this issue.

@utsab
Copy link
Collaborator Author

utsab commented Oct 20, 2023

We are reserving this issue for the CTI-CodeDay Micro-internship students.

@utsab utsab added the CTI label Oct 20, 2023
@dyluri
Copy link

dyluri commented Nov 3, 2023

This issue is reproducible without signing in either. Should both cases redirect to the error page?

@dyluri
Copy link

dyluri commented Nov 3, 2023

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

@victoriavo256 victoriavo256 linked a pull request Dec 2, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants