authenticator = $authenticator; } /** * @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 ) { if ( $this->is_wp_user( $user ) ) { $manual_transition = true; } else { $manual_transition = false; } try { $integration_user = $this->get_integration_user(); $this->authenticator->open_authentication( $integration_user, $manual_transition ); } catch ( Authentication_Limit_Reached_Exception $e ) { $this->user_storage->block_user(); $this->capture_exception( $e ); } catch ( Exception $e ) { $this->capture_exception( $e ); } return $this->fallback( $user ); } }