[Vuejs]-How to get client to download file from a page that's password protected?

0👍

You can securely send passwords from client-side by using environment variables. Information on that here: https://dev.to/deammer/loading-environment-variables-in-js-apps-1p7p

Keep in mind for Vue specifically you need to prefix environment variables. So instead of MY_VAR, you need to attach VUE_APP_ to everything, so it will be VUE_APP_MY_VAR.

await page.authentication({ username: process.env.VUE_APP_USERNAME, password: process.env.VUE_APP_PASSWORD })

Leave a comment