Skip to content

Commit 1e3cf62

Browse files
Adding url to setCookie option + making auth fields optional
1 parent 58baac7 commit 1e3cf62

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/routes/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ router.post('/receive_submission', async function(req, res) {
220220
values[key].audit_options.selected_options.forEach(option => {
221221
submission[option.value] = true;
222222
});
223-
}
224-
225-
for (const optionKey of Object.keys(values[key])) {
226-
submission[optionKey] = values[key][optionKey].value;
223+
} else {
224+
for (const optionKey of Object.keys(values[key])) {
225+
submission[optionKey] = values[key][optionKey].value;
226+
}
227227
}
228228
}
229229

src/utils/lighthouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function launchPuppeteer(url, options) {
3636
}
3737

3838
if (options.cookie_name && options.cookie_value) {
39-
page.setCookie({ name: options.cookie_name, value: options.cookie_value });
39+
page.setCookie({ name: options.cookie_name, value: options.cookie_value, url });
4040
}
4141

4242
await page.waitForNavigation();

src/utils/responseBuilder.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function generateAuditDialog(is_schedule) {
125125

126126
const auth_header = {
127127
type: 'input',
128+
optional: true,
128129
element: {
129130
type: 'plain_text_input',
130131
action_id: 'auth_header',
@@ -142,6 +143,7 @@ function generateAuditDialog(is_schedule) {
142143

143144
const cookie_name = {
144145
type: 'input',
146+
optional: true,
145147
element: {
146148
type: 'plain_text_input',
147149
action_id: 'cookie_name',
@@ -159,6 +161,7 @@ function generateAuditDialog(is_schedule) {
159161

160162
const cookie_value = {
161163
type: 'input',
164+
optional: true,
162165
element: {
163166
type: 'plain_text_input',
164167
action_id: 'cookie_value',

0 commit comments

Comments
 (0)