step_token = $step_token; $this->authenticator = $authenticator; $this->session = $session; } /** * @param null|WP_Error|WP_User $user * * @return bool */ public function supports( $user ) { if ( ! $this->login_support->has_final_response() ) { return false; } if ( $this->is_wp_user( $user ) ) { return true; } try { $this->get_wp_user(); return true; } catch ( User_Not_Found_Exception $e ) { return false; } } /** * @param null|WP_Error|WP_User $user * * @return bool|JSON_Response|Redirection_Response|View_Response */ protected function handle( $user ) { $this->step_token->reset(); $this->session->destroy(); $this->authenticator->close_authentication(); return $this->login_support->get_final_response(); } }