Skip to content

Commit

Permalink
Allow unsetting the primary provider for default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Dec 3, 2024
1 parent d369a3a commit cc830ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,8 @@ public static function user_two_factor_options_update( $user_id ) {
$new_provider = isset( $_POST[ self::PROVIDER_USER_META_KEY ] ) ? $_POST[ self::PROVIDER_USER_META_KEY ] : '';
if ( ! empty( $new_provider ) && in_array( $new_provider, $enabled_providers, true ) ) {
update_user_meta( $user_id, self::PROVIDER_USER_META_KEY, $new_provider );
} else {
delete_user_meta( $user_id, self::PROVIDER_USER_META_KEY );
}

// Have we changed the two-factor settings for the current user? Alter their session metadata.
Expand Down

0 comments on commit cc830ce

Please sign in to comment.