Skip to content

feat(outlink): add login protection for share links - #7793

Merged
c121914yu merged 2 commits into
labring:mainfrom
sxf-xiongtao:feat-share-login-auth
Sep 23, 2026
Merged

c121914yu merged 2 commits into
labring:mainfrom
sxf-xiongtao:feat-share-login-auth

Conversation

@sxf-xiongtao

@sxf-xiongtao sxf-xiongtao commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

两个需求:
1.分享链接变成一个"需要登录才能进的入口",而不是人人可用的公开窗口
2.公开分享时访客是匿名的,日志里只能看到一串 shareChat-xxx;一旦要求登录,日志应当能还原到具体团队成员(姓名/头像)。

实现效果:
1.分享链接新增 allowAnonymous 配置项,可开可关,开=保持历史公开行为,关=必须登录
2.关闭免登录后,访客打开链接被引导登录,登录后校验其对本应用是否有读权限,有权可聊、无权拒绝
3.关闭免登录后,对话身份改用登录成员的 tmbId,而非前端自定义 outLinkUid,防止伪造身份
4.对话日志(app_chat_logs)能正确归因:登录访客显示成员姓名,匿名访客显示外链 UID
5.存量分享链接(无 allowAnonymous 字段)行为不变,仍为公开

@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown

Build and publish successful - Preview fastgpt Image:

ghcr.io/labring/fastgpt-pr:fastgpt_48a2080e5f3f05a528b32dd44505a6d9aae65aa3

🕒 Time: 2026-09-23 14:46:34 (UTC+8)

@sxf-xiongtao
sxf-xiongtao force-pushed the feat-share-login-auth branch 2 times, most recently from ad6f22c to 66da3dc Compare September 21, 2026 03:15
ctlaltlaltc
ctlaltlaltc previously approved these changes Sep 21, 2026
Include the locale header required by the app logs list test.
@c121914yu
c121914yu merged commit 5ff0121 into labring:main Sep 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants