Hello! I’m pretty new to Bedrock/Sage - one problem I ran into was I wanted to conditionally enable HTTP basic auth on staging sites (preferably without modifying the Bedrock environment configs). I created a tiny WordPress plugin to do just this simply by adding credentials to the .env. Feedback / PRs are more than welcome!
- Add the package to your bedrock installation with
composer require aprivette/bedrock-authand activate the plugin in WordPress.
- Add the
BASIC_AUTH_PASSvariables to your .env file.
- Navigate to the site and it should require you to login.