Password protection / basic auth not working with forms+ lambda


We have a site at which uses a netlify form + a submission-created lambda to process the form data

We need to prevent public access to this webpage, so we have tried both simple password protection and the basic auth methods specified in the docs, however whenever these are enabled our lambda function does not get trigger on form submission. As soon as we turn these off everything works great again.

Is that expected behaviour?


Yes, that’s expected. When using password protection, ALL requests must be authenticated. For basic-auth, have you tried doing something like this:

Thanks - looks like I had the route for basic auth misconfigured, it seems to work fine now

1 Like