Commit 41cbc54
fix(plugin-auth): GET /organization/list-user-invitations honours the declared requireEmailVerificationOnInvitation (#16730)
* fix(plugin-auth): list-user-invitations honours the declared requireEmailVerificationOnInvitation
better-auth 1.7.2's listUserInvitations refuses every unverified session
unconditionally, while accept / reject / get-invitation read the option
AuthManager declares false. Rebuild the endpoint in place on the
organization plugin's own endpoints record from the vendor's own options
object, with the verification refusal asked against the declared option;
the listing stays the vendor's getOrgAdapter(...).listUserInvitations
(session email, pending only).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* test(plugin-auth): pin the rebuilt listing endpoint by contract identity, not options identity
createAuthEndpoint shallow-copies the options record to append its base
middleware, and the vendor's $ERROR_CODES entry carries a toString helper;
pin method/query/metadata by identity and code/message by value.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(plugin-auth): gate follow-through for the rebuilt listing endpoint
- classify the restated vendor code as foreign-vocabulary (dispatcher
error vocabulary row, same shape as the impersonate precedent's)
- let the engine-double ledger record the new suite's doubles
- apply the fake engine's limit by presence, not truthiness
- log the vendor-drift fallback at warn: a visible 403 is a functional
degradation under AGENTS.md's one-question rule, not a durability one
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(runtime): keep the tracker id out of the vocabulary row's prose
check:doc-authoring — a runtime string reaches readers who cannot resolve
an issue id; the anchor lives in git history and the source comment.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(gates): declare the list-user-invitations endpoint conformant in PLUGIN_ROUTE_MODULES
The module added for the declared-verification fix writes a Hono response, so
the route-envelope walk discovers it, and a discovered file absent from the
table is an ERROR rather than a default.
Measured with the gate's own `scanHonoRouteSource`: one body, all six asserted
counters zero. The single write is `return ctx.json(pendingInvitations)`, whose
argument is an identifier -- the deliberate relayed-body blindness -- and the
three refusals are `throw APIError.*`, which this surface does not count. So
`{}` is the honest declaration: nothing this file builds departs from the
envelope. No ruled state applies and nothing was hoisted.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7f745c3 commit 41cbc54
7 files changed
Lines changed: 839 additions & 2 deletions
File tree
- .changeset
- packages
- plugins/plugin-auth/src
- runtime/src
- scripts
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
2792 | 2796 | | |
2793 | 2797 | | |
2794 | 2798 | | |
2795 | | - | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
2796 | 2805 | | |
2797 | 2806 | | |
2798 | 2807 | | |
| |||
3168 | 3177 | | |
3169 | 3178 | | |
3170 | 3179 | | |
3171 | | - | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
3172 | 3220 | | |
3173 | 3221 | | |
3174 | 3222 | | |
| |||
0 commit comments