Skip to content

Commit

Permalink
Merge pull request #62 from humanmade/backport-60-to-v3-branch
Browse files Browse the repository at this point in the history
[Backport v3-branch] Re-enable require-login by default in non-production environments
  • Loading branch information
roborourke authored Jun 24, 2020
2 parents fd9bbf2 + 1731aff commit b08d25a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/require-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

By default, all websites are publicly accessible. In some situations, you may want to require users to be logged in to access the website. This is especially useful when in pre-launch mode.

Environments running in Cloud that are not of type `production` have the `require-login` feature enabled by default.

## Controlling Site Access

Requiring login on individual sites is as easy as unchecking the site's public setting in the Edit Site screen. To access this setting, go to [My Sites > Network Admin > Sites](internal://network-admin/sites.php) and then click the URL for the site you want to edit. From there you check the box for whether the site is public or not under the "Attributes" section.
Expand Down
3 changes: 2 additions & 1 deletion load.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Altis\Security; // @codingStandardsIgnoreLine

use Altis;
use function Altis\register_module;

add_action( 'altis.modules.init', function () {
$default_settings = [
'enabled' => true,
'require-login' => false,
'require-login' => ! in_array( Altis\get_environment_type(), [ 'production', 'local' ], true ),
'audit-log' => true,
'2-factor-authentication' => true,
'minimum-password-strength' => 2,
Expand Down

0 comments on commit b08d25a

Please sign in to comment.