SOLVED: Filters: indexing in progress - times out / does not index if HTTP Auth enabled

Browser: Opera
OS: Win 11
URL: request if needed as behind HTTP Auth
Video: Jam

Described in Jam.

Many thanks

Mick

Hi @Michael ,

Please can you try to disable the HTTP Auth and check if the job runs?

Regards,
Jenn

1 Like

Hi Jenn

I hope you are well mate, thanks for the reply. Yes that works and the cron job runs.

The only issue is not being able to do so with HTTP Auth active. I am not sure if there is a workaround or a fixable solution or if it is just not possible whilst HTTP Auth is active?

Many thanks again mate.

Hi @Michael ,

Can you try this snippet with HTTP Auth enabled?

add_filter( 'bricks/remote_post', 'additional_remote_args', 10, 2 );

function additional_remote_args( $args, $url ) {
  if ( strpos( $url, 'action=bricks_background_index_job' ) === false ) {
    return $args;
  }

  // Add Basic Auth to the request
  $username = 'XXXX';
  $password = 'XXXX';

  $args['headers']['Authorization'] = 'Basic ' . base64_encode( $username . ':' . $password );

  return $args;
}

Otherwise, please send admin credentials to help@bricksbuilder.io and include this forum thread URL as a reference.

Regards,
Jenn

2 Likes

That works perfectly Jenn :+1:

Many thanks

Michael

Nice, we just updated the academy as well.

1 Like

Awesome Jenn, just a suggestion if I may, for the less experienced, I would possibly add in the academy notes to make sure that they replace the xxxx in the code with the username & password of their HTTP Auth credentials. :blush:

1 Like