# Setting host on DS.RESTAdapter removing ember-simple-auth headers

**URL:** https://discuss.emberjs.com/t/setting-host-on-ds-restadapter-removing-ember-simple-auth-headers/5864
**Category:** Ember Data
**Created:** [July 9, 2014, 1:39pm UTC](https://discuss.emberjs.com/t/setting-host-on-ds-restadapter-removing-ember-simple-auth-headers/5864 "2014-07-09T13:39:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![envex](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/envex/32/5823_2.png) [@envex](https://discuss.emberjs.com/u/envex)
#### Post date: [July 9, 2014, 1:39pm UTC](https://discuss.emberjs.com/t/setting-host-on-ds-restadapter-removing-ember-simple-auth-headers/5864/1 "2014-07-09T13:39:11Z")

</div>

I’m using the ember-cli-simple-auth with ember-cli and everything it working great, until I try and set a new host on DS.RESTAdapter application wide.

As soon as I set

```
// adapters/application.js
exports default DS.RESTAdapter.extend({
    host: 'https://api.example.com'
});

```

or even using reopen() it clears all the headers set by ember-simple-auth.

Am I not setting this up right in ember-cli?

---

<div class="post-metadata">

### Author: ![marcoow](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marcoow/32/14790_2.png) [@marcoow](https://discuss.emberjs.com/u/marcoow)
#### Post date: [July 25, 2014, 3:12pm UTC](https://discuss.emberjs.com/t/setting-host-on-ds-restadapter-removing-ember-simple-auth-headers/5864/2 "2014-07-25T15:12:29Z")

</div>

Ember Simple Auth doesn’t inject the `Authorization` header for cross origin requests. You’d have to whitelist the origin explicitly: [http://ember-simple-auth.simplabs.com/ember-simple-auth-api-docs.html#SimpleAuth-Configuration-crossOriginWhitelist](http://ember-simple-auth.simplabs.com/ember-simple-auth-api-docs.html#SimpleAuth-Configuration-crossOriginWhitelist)
