我'm using ember-simple-auth with ember-simple-auth-token for authentication API, and I'm和Ember Simple Auth (with token plugin) won't add the Authorization header with the token有同样的问题,但我无法弄清楚如何修复它 .
服务器显然正在使用令牌进行响应,但后续请求在标头中没有令牌 . GET请求应该在 Headers 中有令牌,对吗?
这些是我的选择:
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: {}
};