Hello! Thanks for such a great identity solution. ...
# talk-kratos
b
Hello! Thanks for such a great identity solution. Does anyone have any examples of how to SSR the flows (in Next.js) but submit the forms client-side? Despite setting the cookie and
csrf_token
in the request body, I keep getting a CSRF error when submitting the form.
p
@User make sure that the domain your browser is on is matching the cookie domain. Kratos sets a CSRF cookie as well and if those don't match it will fail the request.
b
Thanks @User. I did reuse some code from the next-edge integration to modify the forwarded cookie properties (i.e cookie domain). Would this not work?
p
Hi @User I see, so you are using the #cloud product. You need to run the proxy in front of your application - the ory integrations library does just that. I would recommend checking out this blog post https://www.ory.sh/login-spa-react-nextjs-authentication-example-api-open-source/
In production you can switch over to a Custom Domain name and use that instead of the proxy. Check out these resources: • https://www.ory.sh/docs/guides/cli/proxy-and-tunnelhttps://www.ory.sh/docs/guides/custom-domains
b
Thanks once again @User. I am indeed using Ory Cloud. I'll take a look through those resources
👍 1