# Cannot redirect to Discourse. Error: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource

**URL:** <https://meta.discourse.org/t/cannot-redirect-to-discourse-error-response-to-preflight-request-doesnt-pass-access-control-check-no-access-control-allow-origin-header-is-present-on-the-requested-resource/65191>\
**Category:** WordPress\
**Created:** [Junho 27, 2017, 12:06pm UTC](https://meta.discourse.org/t/cannot-redirect-to-discourse-error-response-to-preflight-request-doesnt-pass-access-control-check-no-access-control-allow-origin-header-is-present-on-the-requested-resource/65191 "2017-06-27T12:06:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Toan\_Bao\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toan_bao_nguyen/32/74455_2.png) [@Toan\_Bao\_Nguyen](https://meta.discourse.org/u/Toan_Bao_Nguyen)\
**Post date:** [Junho 27, 2017, 12:06pm UTC](https://meta.discourse.org/t/cannot-redirect-to-discourse-error-response-to-preflight-request-doesnt-pass-access-control-check-no-access-control-allow-origin-header-is-present-on-the-requested-resource/65191/1 "2017-06-27T12:06:09Z")

</div>

Hi,  
I am using [WP Discourse](https://github.com/discourse/wp-discourse) for my wordpress website for SSO.

When I checked the option “Automatically create and login users.” When I log in into my site (with ajax call), my console shows this message: “Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource”.

Otherwise, when I unchecked the option “Automatically create and login users.”. It turns out that when I log in to the existing account on my website. When I open discourse, it can not auto login to my account in discourse eventhough my existing account is created in discourse database. It is required to click on “Login” button on discourse to login without entering my username and password.

---

_[View the full topic](https://meta.discourse.org/t/cannot-redirect-to-discourse-error-response-to-preflight-request-doesnt-pass-access-control-check-no-access-control-allow-origin-header-is-present-on-the-requested-resource/65191)._
