idurar / idurar-erp-crm

Free Open Source ERP CRM Accounting Invoicing Software | Node Js React
https://cloud.idurarapp.com
GNU Affero General Public License v3.0
6.56k stars 2.02k forks source link

preflight response does not include PATCH in the "Access-Control-Allow-Methods header" #1193

Open mohitparmar1 opened 1 week ago

mohitparmar1 commented 1 week ago

Describe the bug The PATCH method triggers a CORS error when attempting to update the profile. The preflight response does not include PATCH in the Access-Control-Allow-Methods header.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://cloud.idurarapp.com and log in.
  2. Trigger a profile update that uses a PATCH request.
  3. Check the console/network tab.
  4. See error

Expected behavior The PATCH request should be allowed, and the update should proceed without a CORS error.

Screenshots Screenshot 2024-11-09 151352

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

mohitparmar1 commented 1 week ago

@salahlalami if it is a valid issue I would like to work on this!

surjeet88 commented 1 week ago

Hi @mohitparmar1 i have a cloned copy of the code on my local machine there i have an admin user made through setup file when i update the profile in there then i am not seeing any error but in the deployed code there is indeed an error.It's my first time working on an open source project.Could you guide why this is happening?

mohitparmar1 commented 1 week ago

Hi @mohitparmar1 i have a cloned copy of the code on my local machine there i have an admin user made through setup file when i update the profile in there then i am not seeing any error but in the deployed code there is indeed an error.It's my first time working on an open source project.Could you guide why this is happening?

Yes, but the changes are not updating there, suppose someone changed their last name it is not showing new changes after the update

surjeet88 commented 1 week ago

Here is my name before change Screenshot from 2024-11-10 12-01-28 and this is after Screenshot from 2024-11-10 12-01-42 @mohitparmar1

surjeet88 commented 1 week ago

Hi @mohitparmar1 i have a cloned copy of the code on my local machine there i have an admin user made through setup file when i update the profile in there then i am not seeing any error but in the deployed code there is indeed an error.It's my first time working on an open source project.Could you guide why this is happening?

Yes, but the changes are not updating there, suppose someone changed their last name it is not showing new changes after the update

I saw your PR you added the method parameter to the cors middleware it is necessary for patch.I am new to open source as i could understand you changed just one line is that correct or you made some other changes?