Bypass Basic HTTP Auth when @netlify/lighthouse-plugin runs

Hello,

I’ve been trying to integrate lighthouse-plugin for our netlify deploy-previews, however when it runs at post-deploy, getting a 401 error… then I realized I have implemented basic HTTP auth for our netlify domains for security using a custom middleware…

I’m wondering how can I bypass auth when plugin is the one trying to access my deploy-previews? or is there anyway I can pass the user:pass using netlify.toml?

this is my netlify.toml:

[[plugins]]
  package = "@netlify/plugin-lighthouse"

  # Set the plugin to run prior to deploy, failing the build if minimum thresholds aren't set
  [plugins.inputs]
    fail_deploy_on_score_thresholds = true

  # Set minimum thresholds for each report area
  [plugins.inputs.thresholds]
    accessibility = 0.98
    best-practices = 0.92
    seo = 0.98

any help or suggestions will be much appreciated. TIA

If you’re using Netlify’s auth, the config that you’ve shared would work. For anything custom like you said you’ve done, there’s no way to bypass it. You can submit a feature request on the plugin repo: netlify/netlify-plugin-lighthouse: Netlify Plugin to run Lighthouse on each build (github.com)

1 Like