Skip to content

Commit

Permalink
Merge pull request #374 from humanmade/disable-two-factor-forced-roles
Browse files Browse the repository at this point in the history
Allow disabling 2FA in config
  • Loading branch information
joehoyle authored Dec 4, 2024
2 parents fb88f00 + b46030b commit 6049e7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ function override_two_factor_universally_forced( bool $is_forced ) : bool {
*/
function override_two_factor_forced_user_roles( $roles ) {
$config = Altis\get_config()['modules']['security']['2-factor-authentication'];
if ( ! empty( $config['required'] ) && is_array( $config['required'] ) ) {

if ( isset( $config['required'] ) && $config['required'] === false ) {
return [];
}

if ( is_array( $config['required'] ) ) {
return $config['required'];
}

Expand Down

0 comments on commit 6049e7f

Please sign in to comment.