Skip to content

Commit

Permalink
Switch back to providers list due to API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jan 9, 2025
1 parent 2a39f2a commit 03c2cab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,10 @@ public static function user_two_factor_options( $user ) {
* @return bool True if the provider was enabled, false otherwise.
*/
public static function enable_provider_for_user( $user_id, $new_provider ) {
if ( ! in_array( $new_provider, self::get_providers_classes(), true ) ) {
$available_providers = self::get_providers();

// Ensure the provider is even available.
if ( isset( $available_providers[ $new_provider ] ) ) {
return false;
}

Expand Down

0 comments on commit 03c2cab

Please sign in to comment.