Hello Guys! I hope you’re well,
First of all sorry for my bad english, i try to make a good explanation,
I have a proyect, in this i use axios to make a POST peticion, to make this peticion i use netlify serverless functions to use the entry endpoint, this endpoint point to supabase.
Well, i use thunder client to check if my endpoint works well, and it is correct.
But my problem surge with i make a axios.post to call my function, this show: “Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.”
This axios is called with a function in vercel app.
This is my output in my serverless function:
This is my call to suppabase with the POST method, i try to use middy cors to solve it but i dont can.
This is mi axios peticion, i pass a object with the data necsary to process it. i try in this point with:
{ “key”: “Access-Control-Allow-Headers”, “value”: “X-UserSession”, “Access-Control-Allow-Origin”: “*”, “Access-Control-Allow-Methods”: “POST”, “Access-Control-Allow-Headers”: “Content-Type, Authorization” }
But i cant solve it.
This is the error, at this moment the error is changed, now show me this:
Access to XMLHttpRequest at ‘https://illustrious-kataifi-6f58a4.netlify.app/SupabaseTest’ from origin ‘https://dash-job.vercel.app’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Sorry for the answer, i am a new web developer and i have a lot of questions,
Thank you very much for your help.