WeKnora/internal
sunmh 47d95cd720 feat(invitation): add auto-accept switch for inviting registered users
Add a global tenant switch (tenant.auto_accept_invitation /
WEKNORA_TENANT_AUTO_ACCEPT_INVITATION, default false). When enabled,
inviting an already-registered user adds them to the tenant as an
active member immediately, instead of creating a pending invitation
the invitee must accept from their inbox.

Backend:
- CreateInvitation reads the switch and, when on, calls the new shared
  addMemberAndRespond helper (extracted from TenantMemberHandler.AddMember)
  to persist the member and write the HTTP response. Both call sites
  share it so the sentinel->status mapping can't drift apart.
- Register the setting in the system_setting registry (bool, default
  false).
- Expose the switch as capabilities.auto_accept_invitation on
  GET /auth/me, so the SPA can adapt the invite popup without calling
  the super-admin settings API.
- Cover enabled/disabled, already-a-member, unknown email, owner role
  rejection, and nil member service with unit tests.

Frontend:
- The invite popup adapts to the mode. With auto-accept, the form
  submits directly (button reads "Send", no "confirm invitation" step)
  and refreshes the member roster silently (no toast; the new row is
  the feedback). The classic two-step flow is unchanged when off.
- Fix capabilities hydration: refreshFromAuthMe (the only reader of
  /auth/me capabilities) was invoked solely from the invitation-token
  flow, so on page reload can_create_tenant and auto_accept_invitation
  stayed at their initial false. Trigger it from initFromStorage once a
  token is restored so deployment switches are reconciled with the live
  server.
2026-08-10 15:04:29 +08:00
..
agent fix: replace all exact wiki text matches 2026-08-05 19:30:40 +08:00
application feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common fix(knowledge): harden auto-tagging and let it respect manual tags 2026-08-07 15:35:58 +08:00
config refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
container feat: add Metaso web search provider 2026-08-10 13:33:55 +08:00
database fix(knowledge): address auto-tag review findings 2026-08-07 15:01:01 +08:00
datasource feat(feishu-driver): 新增飞书云盘数据源 (#2466) 2026-08-05 19:39:49 +08:00
errors refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
event feat(mcp): prompt and resume OAuth authorization mid-conversation 2026-06-29 23:22:28 +08:00
handler feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
im fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
infrastructure feat: add Metaso web search provider 2026-08-10 13:33:55 +08:00
logger feat(tracing): migrate langfuse client to OTLP/OTel wire protocol 2026-07-17 16:30:45 +08:00
mcp fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
middleware fix: harden shared agent source selector validation 2026-07-30 12:28:23 +08:00
modelcontext fix(web_fetch): address review follow-ups for structured fetch results 2026-07-28 22:17:31 +08:00
models fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router feat: 邀请链接在 invite_only 模式下改为登录后加入空间 2026-08-10 14:57:38 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox perf(sandbox): compile command-substitution regexps once 2026-06-16 19:51:32 +08:00
searchutil fix(chunks): trim trusted overlaps by exact position, not text search 2026-08-06 12:26:15 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
stream feat(redis): support TLS for Redis connections (#1930) 2026-07-06 23:02:02 +08:00
tracing/langfuse feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
types feat: add Metaso web search provider 2026-08-10 13:33:55 +08:00
utils fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00