user_storage = $user_storage; $this->options_storage = $options_storage; } /** * @inheritDoc */ public function handle( $user, $response = null ) { if ( $this->is_wp_user( $user ) && $this->user_storage->is_wp_user_set() && ( ! $this->user_storage->is_totp_enabled() || ! $this->user_storage->is_totp_configured() ) && ! $this->options_storage->has_obligatory_role( $user->roles ) ) { return $this->json( [ 'user_id' => $user->ID ] ); } return $this->run_next( $user, $response ); } }