Hello folks, my name is Christian. I am trying to ...
# talk-kratos
f
Hello folks, my name is Christian. I am trying to switch from clerk to ory for my application. I'm using ory managed in dev-mode and nextjs 13 for my frontend. Also i want to implement my own ui like here: https://github.com/ory/kratos-selfservice-ui-react-nextjs/tree/master But when I try this, I run into a CORS error. Or when I'm using a next rewrite config like this, I run into a csrf error:
Copy code
const nextConfig = {
    rewrites() {
    return [
      { source: "/ory/:path*", destination: `${process.env.ORY_API_URL}/:path*` },
    ];
  },
}
I've tried to fix this by changing my project's cors settings with this cli command:
Copy code
ory patch project PROJECT_ID \
  --replace '/cors_public/enabled=true' --replace '/cors_public/origins=["<http://localhost:3000>"]'
This partially works to create a new login flow:
Copy code
.createBrowserLoginFlow({
        refresh: Boolean(refresh),
        aal: aal ? String(aal) : undefined,
        returnTo: returnTo ? String(returnTo) : undefined,
      })
But on submit, I get a cors error again:
Copy code
.updateLoginFlow({
        flow: String(flow?.id),
        updateLoginFlowBody: values,
      })
Has anyone ever had a similar problem? Thanks for you support!