user_storage = $storage->get_user_storage(); $this->authentication_storage = $storage->get_authentication_storage(); $this->login_token_manager = $login_token_manager; $this->request = $request; } /** * @param WP_Error|WP_User $user * @param JSON_Response|View_Response|Redirect_Response|Not_Handled_Response|null $response * * @return JSON_Response|Redirect_Response|View_Response|Not_Handled_Response * * @throws User_Not_Found_Exception * @throws DateTime_Creation_Exception */ public function handle( $user, $response = null ) { if ( ! empty ( $this->request->request( 'reauth' ) ) ) { if ( $this->user_storage->is_wp_user_set() ) { if ( ! is_null( $this->login_token_manager->get() ) ) { $this->login_token_manager->reset(); } $authentication = $this->authentication_storage->get_authentication( $this->user_storage->get_user_id() ); if ( ! is_null( $authentication ) ) { $this->authentication_storage->close_authentication( $authentication ); } } return $this->not_handled(); } return $this->run_next( $user, $response ); } }