mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #24311] issue: Bug get_shared_chat_by_id uses get_chat_by_id(share_id) for admin, causing 401 Unauthorized #58926
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kyncc on GitHub (May 2, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24311
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.9.2
Ollama Version (if applicable)
No response
Operating System
macos
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Admin users should be able to access shared chat links just like non-admin users. When an admin clicks "Share" on a chat and then opens the share link (or refreshes the shared chat page), the shared chat content should be displayed successfully.
Actual Behavior
Admin users receive a
401 Unauthorizederror when accessing shared chat links viaGET /api/v1/chats/share/{share_id}. The browser Network tab shows:Important: Non-admin users are NOT affected by this bug. They can access shared chat links normally.
Steps to Reproduce
ENABLE_ADMIN_CHAT_ACCESS=trueis the default).admin).Logs & Screenshots
GET /api/v1/chats/share/8c99ccca-83bd-4d8b-b54e-b09ca2c0671e HTTP/1.1 401 Unauthorized
Additional Information
user).@MukundaKatta commented on GitHub (May 3, 2026):
The fix is simple but worth scanning the rest of the share-id endpoints for the same pattern. Admin paths often get the standard "by_id" helper plugged in by mistake when they should be hitting a "by_share_id" helper that doesn't enforce per-user ownership. Renaming the helpers to
get_chat_by_owner_or_idvsget_chat_by_share_tokenwould make the intent obvious at the call site and prevent future drift.@FelHell commented on GitHub (May 4, 2026):
I can confirm that this bug exists in Open WebUI version 0.9.2. As an admin, I cannot share a link with another admin user.
@Classic298 commented on GitHub (May 4, 2026):
should be fixed by
cde21b9f6dtesting wanted