Ember简单身份验证为每个请求发送令牌

时间:2015-11-21 04:35:30

标签: authentication ember.js ember-simple-auth

我使用ember-simple-auth和ember-simple-auth-token进行身份验证API,我遇到与Ember Simple Auth (with token plugin) won't add the Authorization header with the token相同的问题,但我无法做到弄明白如何解决它。

服务器显然正在使用令牌进行响应,但后续请求在标头中没有令牌。 GET请求应该在标题中有令牌,对吗?

这些是我的选择:

 ENV['simple-auth'] = {
    authorizer: 'simple-auth-authorizer:token',
    authenticationRoute: 'login',
    routeAfterAuthentication: '/'
  };

  ENV['simple-auth-token'] = {
    identificationField: 'email',
    serverTokenEndpoint: 'http://localhost:3000/users/compare',
    tokenPropertyName: 'token',
    authorizationPrefix: 'Bearer ',
    authorizationHeaderName: 'Authorization',
    headers: {}
  };

0 个答案:

没有答案