getUserInput('code', 0, UserInput::UINT); } /** * @return void * @throws AjaxException */ public function execute(): void { if(!$this->getCode()) throw new AjaxException("Please enter a valid 6-digit MFA code"); if (!GoogleAuthenticator::verifyCode($this->getCode())) throw new AjaxException("Invalid code"); GoogleAuthenticator::setCookie(); $this->setResponseMessage("QR Code validated successfully"); } }