wix-fetch sends multiple requests?

I’m trying to get OAuth2 to work with a third party API.

export async function send_code(query) {
 let keys = Object.keys(query);
 
 if (keys.includes("code")) {
   let url = "";
   let client_id = "";
   let client_secret = "";
   let code = query["code"];
   let grant_type = "";

   let fullUrl = url + "?client_id=" + client_id + "&client_secret=" + client_secret +
                "&code=" + code + "&grant_type=" + grant_type;
   let result = fetch(fullUrl, {method: "POST", cache:"reload"}).then(
                         response => response.json()
                     );
   // ... handle access token  
   }
    // ... handle failure
 }

The result I get is always:

{resource:"AuthorizationCode",field:"",code:"expired"}

With Postman everything works flawlessly.
Could it be that fetch sends multiple requests. Since after sending the first the code is expired.
And if so how can I solve this?

It even works in the preview. If I hardcode the code to an unused one. But fails always on the published site.

I guess the frontend code gets called twice. Anyway I solved it by catching this issue on the backend. Though it still seems to be a weird thing to happen.