Skip to content

Commit

Permalink
renamed session service content property to data, close #598
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow committed Aug 11, 2015
1 parent 49504da commit 7b9c03d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/services/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { alias, oneWay } = computed;

export default Ember.Service.extend(Ember.Evented, {
isAuthenticated: oneWay('session.isAuthenticated'),
content: alias('session.content'),
data: alias('session.content'),

_forwardSessionEvents: on('init', function() {
Ember.A([
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default DS.JSONAPIAdapter.extend({
let hash = this._super(...arguments);
let { beforeSend } = hash;
hash.beforeSend = (xhr) => {
let accessToken = this.get('session.content.secure.access_token');
let accessToken = this.get('session.data.secure.access_token');
if (this.get('session.isAuthenticated') && !Ember.isEmpty(accessToken)) {
xhr.setRequestHeader('Authorization', `Bearer ${accessToken}`);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/app/services/session-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default Ember.Service.extend({
session: service('session'),
store: Ember.inject.service(),

account: Ember.computed('session.content.secure.account_id', function() {
const accountId = this.get('session.content.secure.account_id');
account: Ember.computed('session.data.secure.account_id', function() {
const accountId = this.get('session.data.secure.account_id');
if (!Ember.isEmpty(accountId)) {
return DS.PromiseObject.create({
promise: this.get('store').find('account', accountId)
Expand Down

0 comments on commit 7b9c03d

Please sign in to comment.