Skip to content

Commit

Permalink
Adding url to setCookie option + making auth fields optional
Browse files Browse the repository at this point in the history
  • Loading branch information
avasconcelos114 committed May 31, 2021
1 parent 58baac7 commit 1e3cf62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ router.post('/receive_submission', async function(req, res) {
values[key].audit_options.selected_options.forEach(option => {
submission[option.value] = true;
});
}

for (const optionKey of Object.keys(values[key])) {
submission[optionKey] = values[key][optionKey].value;
} else {
for (const optionKey of Object.keys(values[key])) {
submission[optionKey] = values[key][optionKey].value;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/lighthouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function launchPuppeteer(url, options) {
}

if (options.cookie_name && options.cookie_value) {
page.setCookie({ name: options.cookie_name, value: options.cookie_value });
page.setCookie({ name: options.cookie_name, value: options.cookie_value, url });
}

await page.waitForNavigation();
Expand Down
3 changes: 3 additions & 0 deletions src/utils/responseBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function generateAuditDialog(is_schedule) {

const auth_header = {
type: 'input',
optional: true,
element: {
type: 'plain_text_input',
action_id: 'auth_header',
Expand All @@ -142,6 +143,7 @@ function generateAuditDialog(is_schedule) {

const cookie_name = {
type: 'input',
optional: true,
element: {
type: 'plain_text_input',
action_id: 'cookie_name',
Expand All @@ -159,6 +161,7 @@ function generateAuditDialog(is_schedule) {

const cookie_value = {
type: 'input',
optional: true,
element: {
type: 'plain_text_input',
action_id: 'cookie_value',
Expand Down

0 comments on commit 1e3cf62

Please sign in to comment.