# 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:** [27 يونيو 2017، 12:06م 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:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [27 يونيو 2017، 3:21م 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/2 "2017-06-27T15:21:51Z")

</div>

I am trying to understand what is not working.

When you uncheck ‘Automatically create and login users’ and then log out of both Discourse and WordPress, can you log into Discourse by clicking the Discourse login button? What should happen is that you are taken through the WordPress login process and are then redirected to Discourse as a logged in user.

When you uncheck ‘Automatically create and login users’ and then logout of Discourse, **but do not log out of WordPress** , can you login to Discourse by clicking the Discourse login button? What should happen is that you are automatically logged into Discourse without having to enter a password. The authentication is being taken care of by WordPress.

> [@Toan\_Bao\_Nguyen](#):
>
> When I log in into my site (with ajax call)

What do you mean by ‘with ajax call’?

---

_[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)._
