@@ -209,35 +209,37 @@ router.post('/receive_submission', async function(req, res) {
209209 user_id : res_data . user . id ,
210210 username : res_data . user . username ,
211211 channel,
212+ auth_header : undefined ,
213+ cookie_name : undefined ,
214+ cookie_value : undefined ,
212215 } ;
213216
217+ console . log ( JSON . stringify ( values ) ) ;
214218 for ( const key in values ) {
215219 if ( values [ key ] . audit_options && values [ key ] . audit_options . selected_options && values [ key ] . audit_options . selected_options . length > 0 ) {
216220 values [ key ] . audit_options . selected_options . forEach ( option => {
217221 submission [ option . value ] = true ;
218222 } ) ;
219- }
220-
221- if ( values [ key ] . audit_url ) {
222- submission . audit_url = values [ key ] . audit_url . value ;
223- }
224-
225- if ( values [ key ] . schedule ) {
226- submission . schedule = values [ key ] . schedule . value ;
223+ } else {
224+ for ( const optionKey of Object . keys ( values [ key ] ) ) {
225+ submission [ optionKey ] = values [ key ] [ optionKey ] . value ;
226+ }
227227 }
228228 }
229229
230230 try {
231231 // Ad-hoc run
232232 if ( ! is_schedule ) {
233-
234233 const options = {
235234 throttling : submission . throttling ,
236235 performance : submission . performance ,
237236 accessibility : submission . accessibility ,
238237 'best-practices' : submission [ 'best-practices' ] ,
239238 pwa : submission . pwa ,
240239 seo : submission . seo ,
240+ auth_header : submission . auth_header ,
241+ cookie_name : submission . cookie_name ,
242+ cookie_value : submission . cookie_value ,
241243 } ;
242244 res . send ( ) ;
243245 await runAudit ( submission . audit_url , submission . user_id , submission . channel , options ) ;
@@ -255,6 +257,9 @@ router.post('/receive_submission', async function(req, res) {
255257 'best-practices' : schedule [ 'best-practices' ] ,
256258 pwa : schedule . pwa ,
257259 seo : schedule . seo ,
260+ auth_header : schedule . auth_header ,
261+ cookie_name : schedule . cookie_name ,
262+ cookie_value : schedule . cookie_value ,
258263 } ;
259264 await runAudit ( schedule . audit_url , schedule . user_id , schedule . channel , options ) ;
260265 } ) ;
0 commit comments