Skip to content

Commit

Permalink
Disable FIDO keys temporarily until plugin version 0.8.0 is released,…
Browse files Browse the repository at this point in the history
… what will need #9 to be resolved
  • Loading branch information
carstingaxion committed Feb 24, 2023
1 parent 97a62f3 commit 630a29c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions inc/two-factor/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function load_plugin() {
// add_filter( 'two_factor_token_email_subject', '');
// add_filter( 'two_factor_token_email_message', '');
// add_filter( 'two_factor_rememberme', '__return_false' ); // false is the default
add_filter( 'two_factor_providers', __NAMESPACE__ . '\\remove_2fa_dummy_provider' );
add_filter( 'two_factor_providers', __NAMESPACE__ . '\\remove_providers' );
add_filter( 'two_factor_enabled_providers_for_user', __NAMESPACE__ . '\\enable_email_provider' );
add_filter( 'two_factor_primary_provider_for_user', __NAMESPACE__ . '\\email_as_default_primary_provider', 10, 2 );

Expand All @@ -63,10 +63,23 @@ function load_plugin() {
* @param array $providers 2FA providers list.
* @return array
*/
function remove_2fa_dummy_provider( array $providers ) : array {
function remove_providers( array $providers ) : array {
if ( isset( $providers['Two_Factor_Dummy'] ) ) {
unset( $providers['Two_Factor_Dummy'] );
}

/**
* TEMP
*
* Disable FIDO keys until plugin version 0.8.0 is released
* and the issue will hopefully be fixed.
*
* @see https://github.com/figuren-theater/ft-security/issues/9
*/
if ( isset( $providers['Two_Factor_FIDO_U2F'] ) ) {
unset( $providers['Two_Factor_FIDO_U2F'] );
}

return $providers;
}

Expand Down

0 comments on commit 630a29c

Please sign in to comment.