Redirect to Wordpress site from client app giving CORS error

  • rohini kajave
    Participant
    # 2 weeks, 2 days ago

    Hello,

    We have angular client application from which we are trying to redirect to WordPress’s page.
    We have wordpress site as ‘https://acesheros.com’ and wordpress rest api authentication plugin is installed at miniorange.

    We have configured ‘JWT Authentication’ to access ‘https://acesheros.com’ wordpress site with token endpoint as ‘https://acesheros.com/wp-json/api/v1/token’. We are able to get the ‘JWT token’ but while redirecting to ‘https://acesheros.com’ by passing token in header, its giving below error

    Access to XMLHttpRequest at ‘https://acesheros.com/’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.

    We also tried with passing below header but still no luck
    ‘Access-Control-Allow-Headers’: ‘Authorization, X-WP-Nonce, Content-Type, X-Requested-With’,
    ‘Access-Control-Allow-Origin’: ‘*’,
    ‘Access-Control-Allow-Methods’: ‘POST,GET,OPTIONS,PUT,DELETE’,
    ‘Access-Control-Allow-Credentials’: ‘true’

    Is there any way/configuration to enable CORS at wordpress site or to whitelist domain?

    Any help will be appreacited.

    Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.