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

[Bug] admin/info route renders error loading pages for "user" role users #21216

Open
siva2204 opened this issue Mar 20, 2021 · 4 comments · May be fixed by #21218
Open

[Bug] admin/info route renders error loading pages for "user" role users #21216

siva2204 opened this issue Mar 20, 2021 · 4 comments · May be fixed by #21218

Comments

@siva2204
Copy link
Contributor

Description:

admin/info route for "user" roles renders error loading pages instead of "you are not authorized to view this page".

Steps to reproduce:

  1. login as "user" role user
  2. navigate to http://x.x.x/admin/info

Expected behavior:

the response must be you are not authorized to view this page

Screenshot from 2021-03-20 15-53-33

Actual behavior:

Screenshot from 2021-03-20 15-56-12

Server Setup Information:

  • Version of Rocket.Chat Server: 3.13.0-develop
  • Operating System: linux
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.18.4 - x64
  • MongoDB Version: 4.2.8

Client Setup Information

  • Desktop App or Browser Version: 88.0.4324.182
  • Operating System: Ubuntu 20.04

Additional context

the actual behaviour should only happen if there's an error while getting responses but the API throws an error for the "user" role type which has been caught by the side effect to re-render the component.

@siva2204
Copy link
Contributor Author

I'm working on that :)

@siva2204
Copy link
Contributor Author

there's no need to run side effects(use effect) if the user role is "user"

@yash-rajpal
Copy link
Member

@siva2204 #21218 solves this issue.

@siva2204
Copy link
Contributor Author

siva2204 commented Mar 20, 2021

@yash-rajpal according to your pr whether a user is authorized or not, it will request server for statistics and calls method instances/get, where the server will throw an error for that method and bad request for API call (check your serverlog & devtools), if user role is "user" which gets catched and component renders again unwantedly. my pr #21221 solves this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants