request = $app->get_request(); $this->step_token_error_result_factory = $step_token_error_result_factory; } /** * @return Result_Error|Result_Request_Not_Handled */ public function authenticate() { if ( $this->is_totp_token_submitted() ) { return $this->step_token_error_result_factory->create_invalid_step_token_result(); } return new Result_Request_Not_Handled(); } /** * @return bool */ private function is_totp_token_submitted() { return $this->request->get_from_post( 'twofas_light_totp_token' ) !== null; } }