From my react application, I'm calling below function i.e. javascript function
export const getUserName=async(author_id,login,password)=>{
return await axios.get(baseURL+`/api/v2/users/${author_id}.json`, {
headers: {'Access-Control-Allow-Origin': '*'}
auth: {username: login,password: password}})
.then(response=>console.log(response))
}
After hitting above method, getting below error
Access to XMLHttpRequest at '<baseURL>/api/v2/users/<id>.json'
from origin 'http://localhost:3000' has been blocked by CORS policy:
Request header field access-control-allow-origin is not allowed by
Access-Control-Allow-Headers in preflight response.
If I hit same url in postman, its working fine where as its not working from react-application.
Let me know if you required any further details.

Since you're making a client-side request to the API, you will need to authenticate with an Oauth token in order for CORS to be implemented. Here's a link to article which goes in to more detail:
https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/making-cross-origin-browser-side-api-requests/
I hope this helps!
Tipene