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!
Setup:
- Add the package to your bedrock installation with
composer require aprivette/bedrock-auth
and activate the plugin in WordPress. - Add the
BASIC_AUTH_USER
andBASIC_AUTH_PASS
variables to your .env file. - Navigate to the site and it should require you to login.