CORS error when trying to access identiy from localserver

I am trying to run netlify locally. I have a site that uses authentication and that works as indented on the netlify server. when I run it locally I am asked to provide the url of the site and I get the message:

Access to fetch at ‘https://focus-under.netlify.app/#/.netlify/identity/settings’ from origin ‘http://localhost:8888’ 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. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

I have looked at this post and added

        localStorage.clear();

in my script, but it does not solve the problem
What can I do?

Hey @psionman,

This doesn’t normally happen. Would you be able to share the repo?

Hi

Sorry for the delay

The repo is at Bitbucket

Oh yeah, before we take a look at your code, is your site password protected by any chance? This kind of an error might occur in such cases.

Thanks for your reply

I think the problem was that I had an incorrect url

sorry to have bothered you