{"record":{"id":"59d60ce33870ba11","repo":"Mintplex-Labs/anything-llm","slug":"passwords-do-not-match-59d60c","errorCode":null,"errorMessage":"Passwords do not match","messagePattern":"Passwords do not match","errorType":"http","errorClass":null,"httpStatus":500,"severity":"warning","filePath":"server/endpoints/system.js","lineNumber":438,"sourceCode":"    \"/system/reset-password\",\n    [isMultiUserSetup],\n    async (request, response) => {\n      try {\n        const { token, newPassword, confirmPassword } = reqBody(request);\n        const { success, message, error } = await resetPassword(\n          token,\n          newPassword,\n          confirmPassword\n        );\n\n        if (success) {\n          response.status(200).json({ success, message });\n        } else {\n          response.status(400).json({ success, error });\n        }\n      } catch (error) {\n        console.error(\"Error resetting password:\", error);\n        response.status(500).json({ success: false, message: error.message });\n      }\n    }\n  );\n\n  app.get(\n    \"/system/system-vectors\",\n    [validatedRequest, flexUserRoleValid([ROLES.admin, ROLES.manager])],\n    async (request, response) => {\n      try {\n        const query = queryParams(request);\n        const VectorDb = getVectorDbClass();\n        const vectorCount = !!query.slug\n          ? await VectorDb.namespaceCount(query.slug)\n          : await VectorDb.totalVectors();\n        response.status(200).json({ vectorCount });\n      } catch (e) {\n        console.error(e.message, e);\n        response.sendStatus(500).end();","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/endpoints/system.js#L420-L456","documentation":"Message 'Passwords do not match' from POST /system/reset-password, delivered as HTTP 500 via the endpoint's catch block. resetPassword throws this error when newPassword (after trimming) does not equal confirmPassword, and the catch converts the throw into {success:false, message:'Passwords do not match'} with a 500 status.","triggerScenarios":"POST /system/reset-password where newPassword and confirmPassword differ — including trailing-space mismatches, since only newPassword is trimmed before the comparison while confirmPassword is stringified raw.","commonSituations":"Typo in one of the two fields; browser autofill filling only confirmPassword; client trimming one field but not the other before sending.","solutions":["Send identical values in newPassword and confirmPassword (compare after applying the same trim to both on the client)","Disable autofill on the confirm field and clear stale values when the token changes","Branch on the message, not just the status — this 500 is a fixable client error, not a server fault"],"exampleFix":"// before\nawait api.post('/system/reset-password', {\n  token, newPassword: 'NewPass123', confirmPassword: 'NewPass123 '\n}); // 500 'Passwords do not match'\n\n// after\nconst pw = newPassword.trim();\nawait api.post('/system/reset-password', {\n  token, newPassword: pw, confirmPassword: pw\n});","handlingStrategy":"validation","validationCode":"// Compare after applying identical normalization to both fields\nconst newPassword = String(rawNewPassword ?? '').trim();\nconst confirmPassword = String(rawConfirmPassword ?? '').trim();\nif (!newPassword) throw new Error('New password is required');\nif (newPassword !== confirmPassword) throw new Error('Passwords do not match');\nawait api.post('/system/reset-password', { token, newPassword, confirmPassword });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trim both fields identically — the server trims only newPassword before comparing","Use a 'confirm password' input with paste-allowed and live match indicator","Turn off browser autofill on reset forms to avoid silent field mismatches"],"tags":["validation","password-reset","client-error-as-500","multi-user"],"backgroundTag":"request-body-validation","analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}