Ember.js 在使用ember simple auth进行Tori身份验证后持久化会话属性的问题

Ember.js 在使用ember simple auth进行Tori身份验证后持久化会话属性的问题,ember.js,ember-cli,ember-simple-auth,ember-cli-rails,Ember.js,Ember Cli,Ember Simple Auth,Ember Cli Rails,我正在使用ember simple auth来实现与torii的身份验证。一切正常,应用程序进行身份验证,但它无法将服务器返回的附加属性持久化到数据中。已验证的。正如身份验证方法所期望的那样,我从authenticator方法返回一个承诺,其中包含附加属性token和email,这些属性将保留到会话的数据中。已身份验证的: // ~/frontend/app/authenticators/torii.js import Ember from 'ember'; import ToriiAuthe

我正在使用
ember simple auth
来实现与
torii
的身份验证。一切正常,应用程序进行身份验证,但它无法将服务器返回的附加属性持久化到
数据中。已验证的
。正如身份验证方法所期望的那样,我从authenticator方法返回一个承诺,其中包含附加属性
token
email
,这些属性将保留到会话的
数据中。已身份验证的

// ~/frontend/app/authenticators/torii.js

import Ember from 'ember';
import ToriiAuthenticator from 'ember-simple-auth/authenticators/torii';

export default ToriiAuthenticator.extend({
  torii: Ember.inject.service(),

  authenticate() {
    return this._super(...arguments).then((data) => {
      return new Ember.RSVP.Promise((resolve, reject) => {
        return Ember.$.ajax({
          url: '/token',
          type:     'POST',
          dataType: 'json',
          data:     { 'grant_type': 'facebook_auth_code', 'auth_code': data.authorizationCode, redirect_uri: data.redirectUri  }
        }).then(response => {
          Ember.run(() => {
            Ember.Logger.log('response', response); // => {access_token: ".....", provider: "facebook-oauth2", token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkI…WxsfQ.xx6fBkwqwm7HeoOpnRWRVCKF71DdIhxyQggcfZ6325s", email: "..@....com"}
            resolve(response);
          });
        }, xhr => {
          Ember.run(() => { reject(xhr.responseJSON || xhr.responseText); });
        });
      });
    });
  }
});
执行身份验证:
this.get('session').authenticate('authenticator:torii','facebook-oauth2')
成功地进行了身份验证,但是
数据的内容。已身份验证的
仅是
{authenticator:“authenticator:Tori”,提供者:“facebook-oauth2”}
,而我希望它也能保存
令牌
电子邮件

除了
torii
之外,我还有一个
design
验证器,默认情况下它成功地保存了其他属性

我使用的是
“ember simple auth”:“1.1.0”、“ember data 2.7.0
ember 2.7.2
都是通过
ember cli rails
实现的

更新1:奇怪的是,如果我在我的
'/token'
中包含
authenticator:“authenticator:designe'
”来自后端的ajax响应,那么
torii
authenticator会保存所有属性