Commit a8384b6
committed
fix(auth): use createRouteHandlerClient in callback for proper session cookies
The callback route was using createClient() which silently ignores
cookie set operations (designed for Server Components). This caused
session cookies to not be set after OAuth callback, resulting in users
being unable to login despite successful GitHub authentication.
Changed to createRouteHandlerClient() which properly handles cookie
operations in Route Handlers, allowing session cookies to be set
correctly after exchangeCodeForSession().
Root cause: createClient() wraps cookie.set() in try-catch and ignores
failures, while createRouteHandlerClient() propagates errors properly.1 parent c62eece commit a8384b6
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments