{"record":{"id":"a73061c9ac0a9226","repo":"fastapi/full-stack-fastapi-template","slug":"new-password-cannot-be-the-same-as-the-current-one","errorCode":null,"errorMessage":"New password cannot be the same as the current one","messagePattern":"New password cannot be the same as the current one","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"backend/app/api/routes/users.py","lineNumber":114,"sourceCode":"    current_user.sqlmodel_update(user_data)\n    session.add(current_user)\n    session.commit()\n    session.refresh(current_user)\n    return current_user\n\n\n@router.patch(\"/me/password\", response_model=Message)\ndef update_password_me(\n    *, session: SessionDep, body: UpdatePassword, current_user: CurrentUser\n) -> Any:\n    \"\"\"\n    Update own password.\n    \"\"\"\n    verified, _ = verify_password(body.current_password, current_user.hashed_password)\n    if not verified:\n        raise HTTPException(status_code=400, detail=\"Incorrect password\")\n    if body.current_password == body.new_password:\n        raise HTTPException(\n            status_code=400, detail=\"New password cannot be the same as the current one\"\n        )\n    hashed_password = get_password_hash(body.new_password)\n    current_user.hashed_password = hashed_password\n    session.add(current_user)\n    session.commit()\n    return Message(message=\"Password updated successfully\")\n\n\n@router.get(\"/me\", response_model=UserPublic)\ndef read_user_me(current_user: CurrentUser) -> Any:\n    \"\"\"\n    Get current user.\n    \"\"\"\n    return current_user\n\n\n@router.delete(\"/me\", response_model=Message)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/fastapi/full-stack-fastapi-template/blob/8063fe54f17d19f01720e055103af9cad3d8f55d/backend/app/api/routes/users.py#L96-L132","documentation":"Error \"New password cannot be the same as the current one\" thrown in fastapi/full-stack-fastapi-template.","triggerScenarios":"Thrown at backend/app/api/routes/users.py:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8063fe54f17d19f01720e055103af9cad3d8f55d","analyzedAt":"2026-08-26T06:49:32.317Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}