CORS on gotrue-js login when working with Netlify Dev

netlify site name: lyvetool.netlify.app

I am using gotrue-js to login a user, while running netlify locally with netlify dev

I have tried this configurations, none of them work:

  auth = new GoTrue({
      APIUrl: 'https://lyvetool.netlify.app/.netlify/identity',
      audience: '',
      setCookie: false,
  });

fails with CORS.

and

  auth = new GoTrue({
      APIUrl: 'http://localhost:8888/.netlify/identity',
      audience: '',
      setCookie: false,
  });

fails with 404.

Is there a way of testing netlify’s identity locally with netlify dev?

The best solution I found until now is running chrome with:

google-chrome --disable-web-security --user-data-dir=.test-google-chrome/