Puppeteer `page.authenticate` messes up CSRF tokens in forms.
This commit is contained in:
parent
05ec1be101
commit
6cab53abd4
|
@ -55,9 +55,8 @@ const path = require('path');
|
||||||
|
|
||||||
if (process.env.AUTH_USER && process.env.AUTH_PASSWORD) {
|
if (process.env.AUTH_USER && process.env.AUTH_PASSWORD) {
|
||||||
await exec("basic authentication", () => {
|
await exec("basic authentication", () => {
|
||||||
return page.authenticate({
|
return page.setExtraHTTPHeaders({
|
||||||
username: process.env.AUTH_USER,
|
'Authorization': `Basic ${new Buffer(`${process.env.AUTH_USER}:${process.env.AUTH_PASSWORD}`).toString('base64')}`
|
||||||
password: process.env.AUTH_PASSWORD
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue