Designing my own Kratos flow UIs (login/register/e...
# talk-kratos
a
Designing my own Kratos flow UIs (login/register/etc) with SvelteKit.. It's a SPA with SSR. Unsure about (a) should I use redirect flows or AJAX, or some hybrid (eg. redirect to create flow id, then AJAX fetch flow id using query param)? (b) Which logic belongs in the server-only rendering/load function, vs. what should go in the client code?
a
all the rendering happens in the client side as Kratos is a headless API and will only send you back a bunch of json responses for a browser client (compared to native mobile app), you are strongly recommended to opt in for browser flows (redirects only) and meanwhile, let the browser take care of the cookie for you (browser will add the cookie for all the top level domains of a website)
a
In other words, using something like frontendApi.createBrowserRegistrationFlow is not recommended?
a
it is strongly recommended actually for browser applications (anything with a javascript as far as my limited understanding of the fronted)
a
But then there's no redirect... right?
a
if you would like to skip the redirects (e.g. because you have SSR), then I'd say you'll need to do the manual work of passing the set-cookie response header from your frontend's backend to the ultimate frontend