{"record":{"id":"8ea24a405caa4e69","repo":"flarum/framework","slug":"the-admin-password-did-not-match-its-confirmation","errorCode":null,"errorMessage":"The admin password did not match its confirmation.","messagePattern":"The admin password did not match its confirmation\\.","errorType":"validation","errorClass":"ValidationFailed","httpStatus":null,"severity":"error","filePath":"framework/core/src/Install/Controller/InstallController.php","lineNumber":121,"sourceCode":"    /**\n     * @throws ValidationFailed\n     */\n    private function makeAdminUser(array $input): AdminUser\n    {\n        return new AdminUser(\n            Arr::get($input, 'adminUsername'),\n            $this->getConfirmedAdminPassword($input),\n            Arr::get($input, 'adminEmail')\n        );\n    }\n\n    private function getConfirmedAdminPassword(array $input): string\n    {\n        $password = Arr::get($input, 'adminPassword');\n        $confirmation = Arr::get($input, 'adminPasswordConfirmation');\n\n        if ($password !== $confirmation) {\n            throw new ValidationFailed('The admin password did not match its confirmation.');\n        }\n\n        return $password;\n    }\n}\n","sourceCodeStart":103,"sourceCodeEnd":127,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Install/Controller/InstallController.php#L103-L127","documentation":"InstallController::getConfirmedAdminPassword() compares 'adminPassword' and 'adminPasswordConfirmation' from the submitted installer form and throws ValidationFailed when they differ, preventing an admin account from being created with a mistyped password.","triggerScenarios":"Submitting the web installer form with mismatched password/confirmation fields; one field left blank while the other is filled (via Arr::get returning null).","commonSituations":"Typos or case/caps-lock differences between the two password boxes; browser autofill filling only one field; truncated paste into the confirmation box.","solutions":["Re-enter the same password in both fields and resubmit","Clear autofilled password fields and type manually","Pre-check equality in client-side validation before form submission"],"exampleFix":"// before\nadminPassword: 'S3cret!', adminPasswordConfirmation: 's3cret!'\n// after\nadminPassword: 'S3cret!', adminPasswordConfirmation: 'S3cret!'","handlingStrategy":"validation","validationCode":"if (($input['adminPassword'] ?? null) !== ($input['adminPasswordConfirmation'] ?? null)) {\n    throw new ValidationFailed('The admin password did not match its confirmation.');\n}\nif (($input['adminPassword'] ?? '') === '') {\n    throw new ValidationFailed('The admin password is required.');\n}","typeGuard":null,"tryCatchPattern":"try {\n    $password = $controller->getConfirmedAdminPassword($input);\n} catch (ValidationFailed $e) {\n    return redirect()->back()->withErrors(['adminPassword' => $e->getMessage()]);\n}","preventionTips":["Add client-side password confirmation matching before submit","Disable autofill on installer password fields (autocomplete=\"new-password\")","Require non-empty passwords server-side, not just equality"],"tags":["validation","password","installation","form"],"backgroundTag":"schema-validation-failed","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}