{"record":{"id":"3a2b264375bc5538","repo":"HKUDS/DeepTutor","slug":"auth-is-disabled-profiles-are-not-available","errorCode":null,"errorMessage":"Auth is disabled — profiles are not available.","messagePattern":"Auth is disabled — profiles are not available\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"deeptutor/api/routers/auth.py","lineNumber":602,"sourceCode":"\n    The uploaded filename and Content-Type are attacker-controlled, so the\n    stored extension (and the media type served back) is derived from the\n    bytes alone. SVG is deliberately unsupported — serving user-supplied SVG\n    is a stored-XSS vector.\n    \"\"\"\n    if data[:8] == b\"\\x89PNG\\r\\n\\x1a\\n\":\n        return \"png\"\n    if data[:3] == b\"\\xff\\xd8\\xff\":\n        return \"jpg\"\n    if data[:4] == b\"RIFF\" and data[8:12] == b\"WEBP\":\n        return \"webp\"\n    return None\n\n\ndef _require_profile_identity(payload: TokenPayload | None) -> TokenPayload:\n    \"\"\"Shared guard for the self-service profile endpoints.\"\"\"\n    if not AUTH_ENABLED or payload is None:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=\"Auth is disabled — profiles are not available.\",\n        )\n    return payload\n\n\n@router.get(\"/profile\", response_model=UserInfo)\nasync def get_profile(\n    payload: TokenPayload | None = Depends(require_auth),\n) -> UserInfo:\n    \"\"\"Return the current user's own account info.\"\"\"\n    current = _require_profile_identity(payload)\n    info = get_user_info(current.username)\n    if info is None:\n        # PocketBase-backed identities have no local record; fall back to the\n        # token claims so the profile page still renders.\n        return UserInfo(\n            id=current.user_id,","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/auth.py#L584-L620","documentation":"Error \"Auth is disabled — profiles are not available.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/auth.py:602 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":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}