Commit 8023564
committed
fix(tests): Fix test-confidential-client.js to match Better Auth response format
Problem:
- test-confidential-client.js expected 302 redirect with Location header
- Better Auth returns 200 with JSON body containing redirect URL
- Wrong client secret (test-secret-key-change-in-production)
- Wrong redirect URI (/callback vs /auth/callback)
Solution:
- Updated to handle Better Auth's JSON response format
- Extract code from body.url using regex match
- Updated CLIENT_SECRET to match trusted-clients.ts
- Updated REDIRECT_URI to match trusted-clients.ts
Result:
- test-confidential-client.js should now pass
- ALL API tests should pass! 🎉
🤖 Generated with Claude Code1 parent 03679ea commit 8023564
1 file changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | | - | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
0 commit comments