React authenticating user from strapi

Hi I am building a simple app where in Strapi I have created a user in users and permissions, so I will attach my backend postman response here.

Now from react frontend I am making a request, and trying to store the jwt in cookies, however getting CORS Error.

   const response = await fetch('http://localhost:1337/api/auth/local', {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            credentials: 'include',
            body: JSON.stringify({
                identifier: username,
                password: password
            })
        });

        const content = await response.json();
console.log(content)

credentials: ‘include’ to get the jwt in cookies, but it is not happening, actually there is a home page and I want only logged in users should access it, which is not happening, I really wish if someone can help me.