{"record":{"id":"1f62a97311b6f9b8","repo":"ruvnet/RuView","slug":"invalid-username-or-password","errorCode":null,"errorMessage":"Invalid username or password","messagePattern":"Invalid username or password","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"archive/v1/src/middleware/auth.py","lineNumber":305,"sourceCode":"            raise AuthenticationError(\"Token verification failed\")\n    \n    def _requires_auth(self, request: Request) -> bool:\n        \"\"\"Check if the request requires authentication.\"\"\"\n        # All API endpoints require authentication by default\n        path = request.url.path\n        return path.startswith(\"/api/\") or path.startswith(\"/ws/\")\n    \n    def _add_auth_headers(self, response: Response, user_info: Optional[Dict[str, Any]]):\n        \"\"\"Add authentication-related headers to response.\"\"\"\n        if user_info:\n            response.headers[\"X-User\"] = user_info[\"username\"]\n            response.headers[\"X-User-Roles\"] = \",\".join(user_info[\"roles\"])\n    \n    async def login(self, username: str, password: str) -> Dict[str, Any]:\n        \"\"\"Authenticate user and return token.\"\"\"\n        user = self.user_manager.authenticate_user(username, password)\n        if not user:\n            raise AuthenticationError(\"Invalid username or password\")\n        \n        # Create token\n        token_data = {\n            \"sub\": user[\"username\"],\n            \"email\": user[\"email\"],\n            \"roles\": user[\"roles\"],\n        }\n        \n        access_token = self.token_manager.create_access_token(token_data)\n        \n        return {\n            \"access_token\": access_token,\n            \"token_type\": \"bearer\",\n            \"expires_in\": self.settings.jwt_expire_hours * 3600,\n            \"user\": {\n                \"username\": user[\"username\"],\n                \"email\": user[\"email\"],\n                \"roles\": user[\"roles\"],","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/middleware/auth.py#L287-L323","documentation":"Error \"Invalid username or password\" thrown in ruvnet/RuView.","triggerScenarios":"Thrown at archive/v1/src/middleware/auth.py:305 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":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}