# CORS Error - New Tenant

**URL:** <https://community.auth0.com/t/cors-error-new-tenant/82606>\
**Category:** Get Help\
**Tags:** api, auth0js, cors\
**Created:** [April 29, 2022, 6:03am UTC](https://community.auth0.com/t/cors-error-new-tenant/82606 "2022-04-29T06:03:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blowers.Max](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blowers.max/32/33197_2.png) [@Blowers.Max](https://community.auth0.com/u/Blowers.Max)\
**Post date:** [April 29, 2022, 6:03am UTC](https://community.auth0.com/t/cors-error-new-tenant/82606/1 "2022-04-29T06:03:04Z")

</div>

Hello, I created a new tenant to use for development and unfortunately came across the error:  
“Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [https://xxxx.us.auth0.com/passwordless/start](https://xxxx.us.auth0.com/passwordless/start). (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 400”.

I am using the following SDK:

- Which SDK this is regarding: Auth0-JS
- SDK Version: V9

I am using localhost:3000 to test right now & I have configured it to be allowed in our applications settings.  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/e/8/e87743600cf075e17cd8b8a8bcdf26a7fb1f4f2b.png)

I have included code snippets of both functions I am testing, one is using Auth0-JS and the other one is using fetch.

My function using web auth:

```auto
var auth = new auth0.WebAuth({
  domain: `${process.env.REACT_APP_AUTH}`,
  clientID: `${process.env.REACT_APP_AUTH}`,
  redirectUri: 'http://localhost:3000',
  responseType: 'token id_token'
});

function sendOTPa(email) {
  auth.passwordlessStart(
    {
      client_id: process.env.AUTH,
      connection: "email",
      send: "code",
      email: email,
    },
    function (err, res) {
      console.log("AUTH-TEST: " + err + res);
    }
  );
}

```

Function using fetch:

```auto
function sendOTPf(email) {
  console.log("Users Email is: " + email);
  fetch(process.env.REACT_APP_AUTHDOMAIN + "/passwordless/start", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    mode: "cors",
    body: JSON.stringify({
      client_secret: process.env.AUTH,
      client_id: process.env.AUTH,
      connection: "email",
      email: email,
      send: "code",
    }),
  }).catch((err) => {
    console.error(err);
  });
}

```

A screenshot of the error:

 ![auth2](https://global.discourse-cdn.com/auth0/original/3X/1/5/15ed96de7e3f7f345247315a8555403208174de8.png)

---

<div class="post-metadata">

**Author:** ![Blowers.Max](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blowers.max/32/33197_2.png) [@Blowers.Max](https://community.auth0.com/u/Blowers.Max)\
**Post date:** [April 29, 2022, 7:13am UTC](https://community.auth0.com/t/cors-error-new-tenant/82606/2 "2022-04-29T07:13:15Z")

</div>

I was able to fix the issue. It was an issue with me not passing the `client_id` correctly & the passwordless connection being enabled.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 29, 2022, 7:26am UTC](https://community.auth0.com/t/cors-error-new-tenant/82606/3 "2022-04-29T07:26:29Z")

</div>

Perfect! Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 1:45pm UTC](https://community.auth0.com/t/cors-error-new-tenant/82606/4 "2022-07-28T13:45:15Z")

</div>


