title: Whats the best practice for storing Basic Auth password?
body: <p>Let's say I'm trying to build a web application using Vue.js where an end user uses a form to subscribe to a newsletter.
  The frontend is a Vue app, the backend is a PHP REST API.</p>
  
  <p>The API requires Basic Auth authentication.</p>
  
  <p>In the frontend I'm calling the API using axios:</p>
  
  <pre><code>axios
      .post('localhost/api/v1/subscriber.php', {
          // I know the data is missing but this is not what the question is about..
          auth: {
              username: 'USER',
              password: 'PASS'
          }
      })
  </code></pre>
  
  <p>Everything is working fine, except that Vue.js is JavaScript and therefore visible on the client side (right click -> Inspect/ View page source) and every end user can see the username and password.</p>
  
  <p>What's the best practice for "storing" the password (and username)?
  Even if <em>PASS</em> was the hashed password, the end user would still be able to use it to to an API call by himself...</p>