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

Don't send entity fields using query parameters on admin edit pages #60

Open
GabrielMajeri opened this issue Apr 20, 2024 · 0 comments
Open
Labels
admin-interface Issues related to the admin interface back-end Issue related to the back end logic of the application enhancement New feature or request front-end Issue relating to UI/UX

Comments

@GabrielMajeri
Copy link
Member

I've seen that the admin interface uses query parameters in the edit page href to store and pass the fields of the existing entity. This is not okay for several reasons:

  • It's inefficient and URLs have length/character limitations.
  • It's a potential security issue (we don't want secret keys and such being stored in the less-secured page URL).
  • It's weird for the user to see such internal information in the page's URL.

How this should work instead is:

  • Use a Next.js route parameter to pass in the entity ID.
  • Look it up in the database; render a 404 error if it doesn't exist anymore.
  • Check if the user has permissions to edit/view that entity.
  • Use the data loaded from the database as initial values for the form fields.
@GabrielMajeri GabrielMajeri added enhancement New feature or request front-end Issue relating to UI/UX back-end Issue related to the back end logic of the application admin-interface Issues related to the admin interface labels Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin-interface Issues related to the admin interface back-end Issue related to the back end logic of the application enhancement New feature or request front-end Issue relating to UI/UX
Projects
None yet
Development

No branches or pull requests

1 participant