# 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:** [June 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:** 7

<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:** [June 29, 2017, 4:50am 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/7 "2017-06-29T04:50:58Z")

</div>

Another option is to set a login redirect on your AJAX login. I just tried it with an AJAX login plugin that has a login redirect option. If you’re using custom code you can probably do the same thing. Setting the login redirect to  
`http://forum.example.com/session/sso?return_path=http://example.com/your-welcome-page`  
should get users logged into Discourse without errors. You need to make sure that the Discourse setting ‘sso allows all return paths’ is enabled for this to work.

---

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