helpful-table-77025
05/31/2022, 8:41 AMapi/.ory
pages) and our kratos instance.
Everything is set up correctly: ssl, CORS. However, we do not want to use next.js or any other proxy. When I try to use ory client without proxy, the session initiation works (/self-service/login/browser
), but actual login/signup doesn’t (self-service/login?flow={id}
), giving an 403 error security_csrf_violation
about csrf_token.
I would appreciate some help 🥲high-optician-2097
helpful-table-77025
05/31/2022, 9:05 AMhigh-optician-2097
helpful-table-77025
05/31/2022, 9:08 AMhigh-optician-2097
helpful-table-77025
05/31/2022, 9:09 AMhigh-optician-2097
git clone <https://github.com/ory/kratos-selfservice-ui-react-nextjs.git>
cd kratos-selfservice-ui-react-nextjs
npm i
export ORY_SDK_URL=<https://yourproject.projects.oryapis.com>
npm run dev
That will setup the app correctly.helpful-table-77025
05/31/2022, 9:17 AMhelpful-table-77025
05/31/2022, 9:29 AMexport ORY_SDK_URL=
is just rewriting the basePath
, so it’s not what I am looking for.
I will try the SPA approach. thank you for the quick answer!high-optician-2097
high-optician-2097
helpful-table-77025
05/31/2022, 9:37 AMhigh-optician-2097
helpful-table-77025
05/31/2022, 9:38 AM/api/.ory/[…paths].ts
and I don’t want that. I want to talk to kratos directly from my component bypassing the next.js middleware parthigh-optician-2097
high-optician-2097
helpful-table-77025
05/31/2022, 9:43 AMhigh-optician-2097
const ory = new V0alpha2Api(new Configuration({
basePath,
baseOptions: {
// Ensures we send cookies in the CORS requests.
withCredentials: true
}
}))
helpful-table-77025
05/31/2022, 9:48 AMwithCredentials: true
, helped!helpful-table-77025
05/31/2022, 9:48 AMhigh-optician-2097
helpful-table-77025
05/31/2022, 9:48 AMhigh-optician-2097
high-optician-2097
helpful-table-77025
05/31/2022, 10:06 AMhigh-optician-2097