This commit is contained in:
Javier Casares 2026-06-06 05:08:20 +00:00
commit 054060374e

View file

@ -1043,7 +1043,20 @@ class Login_Form_Manager {
$frequency = $this->get_effective_frequency( $user, $user_settings );
if ( $this->has_recent_verification( $user, $methods, $frequency ) ) {
return '';
/**
* Filter whether to force a fresh 2FA challenge regardless of the frequency setting.
*
* Return true to always challenge the user, overriding the frequency-based skip.
* Used by GeoIP restrictions to mandate verification from new countries.
*
* @since 1.5.0
*
* @param bool $force Whether to force the challenge. Default false.
* @param \WP_User $user User about to be challenged.
*/
if ( ! (bool) apply_filters( 'robotstxt_2fa_force_challenge', false, $user ) ) {
return '';
}
}
return $this->select_preferred_method( $methods );