haayehenricus
haayehenricus
SSolidJS
Created by haayehenricus on 3/21/2024 in #support
Set cookie from a resource
If I'm using a createResource function that is calling an api which is returning a set-cookie header how can i add the cookies to the browser if the cookie container httponly
8 replies
SSolidJS
Created by haayehenricus on 3/21/2024 in #support
Trouble creating an Ory based login
Hey there, I'm triing to build a Login with ory and solid start but I'm really getting trouble doing all those cookie things. The Steps: Hitting the registration page Getting a so called "Flow" from Ory (by using the cookies to ensure there is no active session) Retreiving the flow and displaying the form also pipe the headers to set the csrf that we got send by ory Submitting the form directly to the Ory instance itself Ory will then redirect to the verify route and set a few cookies by header For the verify route i again have to fetch a flow but this time i need to include the cookies into the request After that i need to set new cookies by the returned headers from ory and display the flow In particular I need something that can retreive all the headers on server side and the client side and that can pipe this information into an whatever function on the backend (currently a (t)rpc) that I could use in order to get stuff from ory. In Remix i had things like a loader that i could use for that. But in Solid Start such a thing does not exists. Using an action that only runs on the server ends in a super slow user interface. The moment i try to use the function on the client too i get an render issue becuase the functions i use are meant to run on the server. Using the HttpHeader Components isn't working because it, for some reason, throws errors while rendering. (i can use hardcoded values but nothing dynamic) I Also tried to use Trpc for doing that but inside of the trpc query for some reason the cookie header is gone. I didn't try API routes until yet because i thought maybe I'm able to do it directly inside of a component like e.g. the LoginForm itself.
2 replies