title: How can I protect a express route without authentication?
body: <p>I'm trying to implement a GET method with Express in my nodeJs application.
  I'd like to do something like this in order to display user data :</p>
  
  <p><code>router.get("/user/:idUser", (req, res) =&gt; {</code></p>
  
  <p>The user doesn't need to be authenticated in order to execute this code. However I don't want that anybody can execute this request with a user id of someone else. Because he could see data he's not supposed to see.</p>
  
  <p>How could I proceed ? I thought about using some encryption process to have something like :</p>
  
  <p><code>/user/PdfgdfJFDGTfrfgdsf</code></p>