{"record":{"id":"a1d656cd0d94b92c","repo":"Mintplex-Labs/anything-llm","slug":"error-resetting-password","errorCode":null,"errorMessage":"Error resetting password.","messagePattern":"Error resetting password\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/models/system.js","lineNumber":194,"sourceCode":"          throw new Error(data.message || \"Error recovering account.\");\n        }\n        return data;\n      })\n      .catch((e) => {\n        console.error(e);\n        return { success: false, error: e.message };\n      });\n  },\n  resetPassword: async function (token, newPassword, confirmPassword) {\n    return await fetch(`${API_BASE}/system/reset-password`, {\n      method: \"POST\",\n      headers: baseHeaders(),\n      body: JSON.stringify({ token, newPassword, confirmPassword }),\n    })\n      .then(async (res) => {\n        const data = await res.json();\n        if (!res.ok) {\n          throw new Error(data.message || \"Error resetting password.\");\n        }\n        return data;\n      })\n      .catch((e) => {\n        console.error(e);\n        return { success: false, error: e.message };\n      });\n  },\n\n  checkDocumentProcessorOnline: async () => {\n    return await fetch(`${API_BASE}/system/document-processing-status`, {\n      headers: baseHeaders(),\n    })\n      .then((res) => res.ok)\n      .catch(() => false);\n  },\n  acceptedDocumentTypes: async () => {\n    return await fetch(`${API_BASE}/system/accepted-document-types`, {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/frontend/src/models/system.js#L176-L212","documentation":"Thrown by resetPassword in the AnythingLLM frontend when POST /api/system/reset-password with { token, newPassword, confirmPassword } fails. It prefers the server's data.message ('Invalid reset token', password-policy complaint) and otherwise uses the generic fallback. Reset tokens are single-use and short-lived.","triggerScenarios":"Submitting an expired or already-consumed reset token; newPassword not matching confirmPassword; a password that violates server policy; a token mangled by an email client wrapping the reset link.","commonSituations":"Clicking an old reset email after requesting a newer one; retrying the same link after a successful reset; password-manager autofill filling the two fields differently; URL line-wrapping truncating the token in webmail clients.","solutions":["Request a fresh reset link and use it immediately.","Confirm both password fields match character-for-character.","Meet the password policy the server enforces (length/complexity).","Copy the full link from the email rather than clicking a wrapped/truncated URL."],"exampleFix":"// before — rely on the server to catch the mismatch\nawait System.resetPassword(token, newPassword, confirmPassword);\n\n// after — fail fast client-side\nif (newPassword !== confirmPassword) {\n  showError('Passwords do not match');\n  return;\n}\nawait System.resetPassword(token, newPassword, confirmPassword);","handlingStrategy":"validation","validationCode":"// run before System.resetPassword\nif (!token) throw new Error('Reset token is missing from the link');\nif (newPassword !== confirmPassword) throw new Error('Passwords do not match');\nif (newPassword.length < 8) throw new Error('Password must be at least 8 characters');","typeGuard":null,"tryCatchPattern":"const { success, error } = await System.resetPassword(token, newPassword, confirmPassword);\nif (!success) {\n  showResetError(error); // server message e.g. 'Invalid reset token'\n  return;\n}","preventionTips":["Use each reset link exactly once and immediately after requesting it.","Copy full reset URLs — email clients wrap long tokens across lines.","Fill both password fields manually or with matching autofill to avoid mismatch 4xxs."],"tags":["anythingllm","authentication","password-reset","token-expired"],"backgroundTag":"password-reset-token-invalid","analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}