Cant manually set cookie using authClient on the server
So first up to make sense of the title. i have a sveltekit app and a hono app. hono has my auth instance and sveltekit only has access to the authClient.
Now i have a bit of a special login where i need the user to fill in something and on the server we add some parts to the username basically.
Im not sure why my approach dosent work because:
1) the signIn function works fine and returns success with data
2) I can set the cookie through sveltekit just fine
3) The auth setup itself also works. i have another login page where i directly call the authClient Signin methods on the client and there everything works fine!
BUT getSession returns me user: null session: null
So i feel like im either missing something or the cookie i manually set is somehow broken.
also let me show the values between the set-cookie header i get on succes vs the thing i parse out of it
set-cookie:
parsedCookie:
i compared the cookies in the browser. they are the exact same
Here is the code:
Now i have a bit of a special login where i need the user to fill in something and on the server we add some parts to the username basically.
Im not sure why my approach dosent work because:
1) the signIn function works fine and returns success with data
2) I can set the cookie through sveltekit just fine
3) The auth setup itself also works. i have another login page where i directly call the authClient Signin methods on the client and there everything works fine!
BUT getSession returns me user: null session: null
So i feel like im either missing something or the cookie i manually set is somehow broken.
also let me show the values between the set-cookie header i get on succes vs the thing i parse out of it
set-cookie:
name.session_token=jItmNnCgdeLOpqJ6NHv6DzKG5rit62hp.Fz%2FVmX2%2BgqRgYSYz4NfO%2FiVoZC9c32OEjC2fxbRv3gY%3D; Max-Age=604800; Domain=.localhost; Path=/; HttpOnly; SameSite=LaxparsedCookie:
i compared the cookies in the browser. they are the exact same
Here is the code: