Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

rc.22+ auth plugin disables better-auth organization/list-members but createAuthClient still ships organizationClient — child UIs silently lose member roles (403)

オープン
#632 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start by reading createAuthClient in everything-dev/ui/auth and the auth RPC listMembers procedure; the issue identifies both the stock organizationClient() setup and the replacement endpoint. Check how the client exposes organization calls and how the RPC client sends its envelope, then compare the list-organizations call sites. Done when organization member queries reach the supported endpoint and the stranded organization list call sites are accounted for.

索引モデルが issue の本文から書いたものです。

説明

bug

Summary

Since rc.22, the parent's auth plugin disables better-auth's built-in POST /api/auth/organization/list-members endpoint (server responds 403 with "Use POST /api/rpc/auth/listMembers — member emails are permission-filtered there"). But the framework's own client factory — everything-dev/ui/auth createAuthClient — still mounts the stock organizationClient() with no client-side remap. Any child calling auth.organization.listMembers(...) now gets 403, the query throws, and member roles silently resolve to undefined. There is no compile-time or runtime signal pointing children at the replacement.

This is the client/server skew class from #531's closure notes (the skew there was composition-level; this one is API-level), and it bit citynode.app's browser regression suite red from rc.22 through rc.24.

Evidence (citynode.app child, extends: bos://dev.everything.near/everything.dev, platform rc.22→rc.24)

  1. Server: GET /api/auth/organization/list-members?organizationId=… → 403 {"message":"Use POST /api/rpc/auth/listMembers — member emails are permission-filtered there"}. Also GET /api/auth/organization/list-organizations → 404. Meanwhile organization/get-full-organization still works, and the server-injected context is complete — POST /api/rpc/auth/getContext returns the full envelope with organization.activeOrganizationId, member.role: "owner", permissions.
  2. Client: [email protected]/dist/ui/auth.mjs line ~120: organizationClient({ teams: { enabled: true } }) — stock better-auth client, no interceptors/remap; the string listMembers appears nowhere in the package.
  3. Replacement works: POST /api/rpc/auth/listMembers with the standard oRPC envelope {"json":{"organizationId":…}} → 200 {"members":[…role:"owner"…],"total":1}. (Note: a raw body {organizationId:…} — the shape the api-plugin oRPC mount accepts — gets 400 "expected object, received undefined" on this mount, another trap for children hand-rolling the call.)
  4. Child symptom: memberRole undefined → tenant-detail gate renders "Community not found" for owners → 8 browser regression specs red (tenancy, team-workspace, community-map-status, community-settings-*, discovery-profile-save, organization-approval, organizer-stations). Green on rc.21, red since rc.22.

Fixed on the child side in https://github.com/NEARBuilders/citynode.app/pull/446 by switching fetchOrgMembers to apiClient.auth.listMembers (the oRPC surface listOrganizations/listUserInvitations already use).

Ask

Pick one (or both):

  1. Remap in the framework client — intercept organization.listMembers in createAuthClient (custom fetch hook / client plugin) and route it to the oRPC procedure, so stock organizationClient() calls keep working; or
  2. Ship a helper — export an orgMembersQueryOptions-style helper (and a documented members surface) from everything-dev/ui/auth so children don't hand-roll the oRPC call or rediscover the envelope shape.

Also consider whether organization/list-organizations (404) left any other client call sites stranded.

Repro

On any child at platform ≥ rc.22, signed in with an org owner session, authClient.organization.listMembers({ query: { organizationId } }) → 403 with the reroute message; useOrgMemberRole-style consumers render locked/unavailable states.

主要言語
TypeScript
スター
5
フォーク
3
平均マージ
9時間 37分
マージ済み PR(30日)
157

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NEARBuilders/everything-dev のほかの issue

NEARBuilders/everything-dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。