Repository navigation
Commit e944fdb
fix(client)!: bind the oauth.* family to the wire shapes better-auth sends (#15445)
* fix(client)!: bind the oauth.* family to the wire shapes better-auth sends
Four methods of the `oauth.*` namespace ended `return res.json()` with no
return annotation, so `lib.dom`'s `Response.json(): Promise<any>` was their
published type. Each now declares the shape its route actually serves, and its
`exported-any-returns.json` entry is deleted in the same change:
oauth.applications.register -> OAuthApplicationRegistration
oauth.applications.get -> OAuthApplication
oauth.applications.getPublic -> OAuthApplicationPublic
oauth.consent -> OAuthConsentResult
The shapes were read off the wire against a real server, not off better-auth's
own `.d.ts` — twice the vendor's declaration was the wider, wrong answer:
`getPublic` is declared as the full client row but its handler hand-picks seven
columns, and `user_id` / `application_type` are declared nullable while the
serialiser folds a null column to `undefined`.
Timestamps are RFC 7591 numbers (Unix epoch seconds), not `Date` and not
ISO-8601 strings: the provider converts its stored `Date` to a number before
serialising, so no `Date` reaches the wire and no revival layer exists.
`oauth.applications.delete` is deliberately NOT bound and keeps its ledger
entry: its route answers HTTP 200 with a zero-byte body, so its `res.json()`
rejects with a SyntaxError on every successful delete. No annotation can be
honest while that call stands, and binding it needs a behaviour change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* chore(changeset): state the ADR-0087 disposition for the oauth.* narrowing
The changeset declares `**BREAKING**` (and a title bang) and carried no
`adr-0087:` disposition, so `check-adr-0087-registration.mjs` exited 1 and
Check Changeset has been red on this PR since 16:01Z. This adds the one
disposition line the gate requires.
Category: `type-surface-only` (#13080). All four of its predicates were
checked against this diff rather than assumed:
1 published @objectstack/client has no `private` field in
packages/client/package.json.
2 no-spec-diff the four changed paths carry no `packages/spec/`
prefix.
3 no-metadata-surface-diff `metadataSurfaceKind` is null for all four.
4 narrowed-from-erased read at both revs with the gate's own
`readDeclaredTypeSurface`: `register`,
`getPublic` and `consent` are unannotated at the
merge base and concrete at HEAD.
Predicate 4 is NOT claimed for the fourth narrowed member. The reference
`packages/client/src/index.ts#get` does not address `oauth.applications.get`:
the file declares 13 members named `get` and the predicate reads the FIRST
(line 1928), which is an unrelated member, unannotated at both revs. Naming it
would assert a verified fact about the wrong member, so it is named in the
disposition's prose instead and the ambiguity is filed as its own card.
No annotation, exported type, method body or ledger row is touched: the
contract settled by the at-tier review is unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d30ccb9 commit e944fdb
4 files changed
Lines changed: 308 additions & 8 deletions
File tree
- .changeset
- packages/client
- src
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 25 | | |
29 | | - | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
887 | 1017 | | |
888 | 1018 | | |
889 | 1019 | | |
| |||
3033 | 3163 | | |
3034 | 3164 | | |
3035 | 3165 | | |
3036 | | - | |
| 3166 | + | |
3037 | 3167 | | |
3038 | 3168 | | |
3039 | 3169 | | |
| |||
3051 | 3181 | | |
3052 | 3182 | | |
3053 | 3183 | | |
3054 | | - | |
| 3184 | + | |
3055 | 3185 | | |
3056 | 3186 | | |
3057 | 3187 | | |
| |||
3064 | 3194 | | |
3065 | 3195 | | |
3066 | 3196 | | |
3067 | | - | |
| 3197 | + | |
3068 | 3198 | | |
3069 | 3199 | | |
3070 | 3200 | | |
| |||
3093 | 3223 | | |
3094 | 3224 | | |
3095 | 3225 | | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
3096 | 3242 | | |
3097 | 3243 | | |
3098 | 3244 | | |
| |||
3113 | 3259 | | |
3114 | 3260 | | |
3115 | 3261 | | |
3116 | | - | |
| 3262 | + | |
3117 | 3263 | | |
3118 | 3264 | | |
3119 | 3265 | | |
| |||
0 commit comments