title: Pass current_user.id to external javascript file
body: <p>I'm trying to get current_user.id from a flask application into an external javascript file. I have a working solution, but am worried it is not secure as I am displaying the user id openly in HTML. My current solution is below. Is there a way to do this without showing the user ID?</p>
  
  <pre><code>// estimate.html
  &lt;script type="text/javascript" src="{{ url_for('static', filename='dashboard/js/estimate/estimate.js') }}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var current_user_id = "{{ current_user.id }}";
  &lt;/script&gt;
  
  // estimate.js
  var data = {
      user_id: current_user_id
  }
  </code></pre>