Commit bccf311
fix(client)!: oauth.applications.register declares only the members /oauth2/create-client accepts (#17209)
* fix(client)!: oauth.applications.register declares only members /oauth2/create-client accepts
`name`, `scopes` and `metadata` were never honoured by the route this method
posts to. The vendor body schema (`@better-auth/oauth-provider@1.7.2`) has no
`catchall`, so zod strips them: the caller got HTTP 201 and a client that
quietly did not have the value. Driven on the card — absent from the response,
from `applications.get`, from `applications.list`, and `null` in the
`sys_oauth_application` row.
The two near-misses were the vendor's RECORD vocabulary, not typos:
`client_name` writes the DB column named `name`, and `scope` writes the column
named `scopes`. `scopes` -> `scope` is therefore not a rename — the array form
is refused (`400 [body.scope] Invalid input: expected string, received array`)
and only a space-joined string passes.
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
* docs(changeset): BREAKING banner and the FROM -> TO prescription for #15447
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
* test(client): the array-form scope case sends the body that produced the recorded 400
The third case in the #15447 pin paired a VALID request (the joined string the
route accepts with 201) with the error the INVALID request produces, against a
double that answers 400 unconditionally — so its title asserted two things the
case could not see. It now sends the array form through a suppression, which is
the body that actually drew the recorded refusal, and the title and comment say
what it pins: the SDK's handling of that refusal, never the route's verdict.
The suppression is load-bearing: after this card's narrowing the array form is
no longer expressible through the declared type, and widening `scope` to accept
one leaves the directive unused and this case red.
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0e45ee8 commit bccf311
3 files changed
Lines changed: 322 additions & 3 deletions
File tree
- .changeset
- packages/client/src
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3842 | 3842 | | |
3843 | 3843 | | |
3844 | 3844 | | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
3845 | 3883 | | |
3846 | 3884 | | |
3847 | 3885 | | |
3848 | | - | |
3849 | 3886 | | |
3850 | 3887 | | |
3851 | 3888 | | |
3852 | 3889 | | |
3853 | 3890 | | |
3854 | 3891 | | |
3855 | 3892 | | |
3856 | | - | |
3857 | 3893 | | |
3858 | 3894 | | |
3859 | 3895 | | |
3860 | | - | |
3861 | 3896 | | |
3862 | 3897 | | |
3863 | 3898 | | |
| |||
0 commit comments