Hi all, I'm going through implementing a custom UI...
# talk-kratos
o
Hi all, I'm going through implementing a custom UI for Kratos and it's going quite well (everything appears to be working). However I'm not sure I've covered all of the expected query parameters that can appear in links that Kratos generates. For example, many of the URLs are expected to take a
flow
or
id
parameter for a flow id. I've been referencing the pages from the react implementation (https://github.com/ory/kratos-selfservice-ui-react-nextjs/blob/master/pages/registration.tsx) to see which additional query parameters are expected (such as
return_to
, etc.). It appears there are some gaps though. For example, when kratos sends a verification email, the link contains a
code
parameter which I'd like to autofill when given. This parameter does not appear in the reference app and I haven't been able to find any docs for it. I'm concerned I might be missing important parameters that appear on other flows. Is there documentation for the expected set of query parameters that can appear in links generated by Kratos that must be supported by the frontend? If not, is there a place I should look in the code to make sure I have all the bases covered?
fwiw a global search for
url.Value
and
urlx.CopyWithQuery
has been somewhat fruitful in looking for the expected API. I haven't found anything besides
code
, but I'm still unsure I got everything
m
@bland-eye-99092 Do you know the status of code in our reference apps or can you help out? here are the docs fwiw but you probably seen them already: https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation
b
The
code
query param is just used by Kratos directly, as the link in the email should point to your Kratos instance (not your own UI). Kratos will then redirect the user’s browser to your UI with a
flow
parameter set so you can fetch & render the flow. The
code
is then “pre-filled” in the
ui
nodes returned by Kratos, via the
value
attribute. If you implemented rendering the nodes with all it’s attributes this should just work. The docs could be a bit clearer on this, for sure.
o
Ah I should've looked more closely at the url to see it was pointing to the kratos backend - thanks for explaining that. It is indeed pre-filling as expected