Open dandin84 opened 3 years ago
Same issue, any solution / work around?
This is my general approach to CORS on WP in case it's helpful, this goes in a custom plugin ideally, or theme functions.php may also work but I've not tested it.
function my_cors_domains( $allowed_origins ) {
$allowed_origins[] = 'http://localhost:4200';
$allowed_origins[] = 'whatever-else';
return $allowed_origins;
}
add_filter( 'allowed_http_origins' , 'my_cors_domains' , 10 , 1 );
Hi,
I installed the plugin on a new clean Wordpress on localhost environment. I am trying to create a login via local React app and get CORS errors. I understand the reason but do you know how can I get through it?
htaccess
wp-config
wp-admin
react call
error
request
Thanks, Daniel