I'm working on a react/express application. The url look something like this: /dashboard?matchID=2252309 . As a user I should only be able to access this url. if I try to modify the matchid I should not be able to see the page. Is it a simple way to do this? One option is to create a endpoint and check through my database for access.
There is no way to restricted the user to enter some URL based on your database. To match your expectation you have two available solutions :
Solution A : Check the user's authorization server-side with a web token and restrict the access to the requested ressource. You will have to implement a login and a permission system.
Solution B : Hide your real ressource ID in a web token (JWT) to make a complicated non-deterministic / non-guessable public Id / URL. Anyone who have the exact URL would have access to the requested ressource.