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] Unintended Access to dRep Registration and Editing Functions #1183

Closed
kneerose opened this issue Jun 6, 2024 · 11 comments
Closed

[BUG] Unintended Access to dRep Registration and Editing Functions #1183

kneerose opened this issue Jun 6, 2024 · 11 comments
Assignees
Labels
🐛 Bug Something isn't working

Comments

@kneerose
Copy link
Contributor

kneerose commented Jun 6, 2024

Context & versions

  • Unrestricted Access to Registration: Registered dReps can access the /register_drep page, intended for new dRep registrations.
  • Uncontrolled Access to Editing: Non-registered users can inappropriately access the /edit_drep page, meant for modifying existing dRep profiles.

Steps to reproduce

dRep user:

  • Log in as a registered dRep user.
  • Navigate to the URL for registering a new dRep /register_drep.

Non dRep User:

  • Access the system with non-dRep users.
  • Navigate to the URL for editing a dRep profile /edit_drep.

Expected behaviour

  • Registered dReps: Upon accessing /register_drep, a registered dRep should be redirected to a relevant page (e.g. dashboard) with a clear message indicating they are already registered.
  • Non-registered Users: When a non-registered user attempts to access /edit_drep, they should be redirected to the registration page (/register_drep) with a message explaining they need to register first.

Allure Report references

@MSzalowski
Copy link
Contributor

That should already be fixed @pmbinapps could you please retest it making sure that the issue no longer exists?

@pmbinapps
Copy link

pmbinapps commented Jun 10, 2024

OK NOW

  • for not connected user, after reload user stays on dashboard when /edit_drep is used
  • for connected as Drep after /edit_drep - Edit drep is used
  • for connected as non-Drep /edit_drep shows Dashboard

@m-i-k-e TBC any behaviour mentioned in Expected results should be implemented.

@kneerose
Copy link
Contributor Author

Hello @pmbinapps ,

The /edit_drep navigation is working fine, but the /register_drep navigation proceeds even if the user is already registered as a dRep.

Impact

  • An error is thrown during registration

image

@kneerose
Copy link
Contributor Author

kneerose commented Jul 2, 2024

Sentry Issue Details

Test Report

@kneerose
Copy link
Contributor Author

@pmbinapps any updates on this?

@pmbinapps
Copy link

@kneerose assigning to @MSzalowski to clarify how to handle /register_drep when user is already a DRep.

@kneerose
Copy link
Contributor Author

kneerose commented Aug 8, 2024

@jdyczka any update on this?

@jdyczka
Copy link
Contributor

jdyczka commented Aug 8, 2024

@kneerose Yes, the same problem exists for retire_drep, register_direct_voter and retire_direct_voter.
As far as how to handle this, instead of automatically redirecting the user, I would show a message with Go to dashboard button. The reason is that we have to fetch some data to know if the user can access this url and so for the automatic redirect scenario there is first a flash of the page with title and loader before the redirect happens.

jdyczka pushed a commit that referenced this issue Aug 9, 2024
jdyczka pushed a commit that referenced this issue Aug 13, 2024
jdyczka pushed a commit that referenced this issue Aug 13, 2024
jdyczka added a commit that referenced this issue Aug 13, 2024
…r-actions

[#1183] Restrict access for registration and retirement routes
@bosko-m
Copy link
Contributor

bosko-m commented Aug 28, 2024

@jdyczka @MSzalowski Is this now deployed?

@kneerose
Copy link
Contributor Author

kneerose commented Sep 3, 2024

I see this message while navigating to the /register_drep page when the user is already a DRep. It seems that the issue has been fixed. What do you think, @MSzalowski and @jdyczka ?

image

CC: @bosko-m

@bosko-m
Copy link
Contributor

bosko-m commented Sep 27, 2024

Closing as per the comment above.

@bosko-m bosko-m closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

8 participants