我'm using ember-simple-auth and ember-simple-auth-token to implement a client side session mechanism. My backend is writtend in django(DRF + DRF jwt) and I'使用ember-django-adapter . 我定义了一个路由用户,一个模型用户但是当我尝试去http://myhost/users我有这个错误:
Error while processing route: users.index Authentication credentials were not provided. Error: Authentication credentials were not provided.
我怎么能告诉django适配器在发出http请求时添加一个特定的授权令牌(从ember-simpe-auth会话中获取)?
谢谢 .
PS:我添加到config \ environment.js这段代码
ENV['simple-auth'] = {
authorizer: 'simple-auth-authorizer:token'
};
ENV['simple-auth-token'] = {
serverTokenEndpoint: 'http://myhost/api/jwt-auth/',
identificationField: 'username',
tokenPropertyName: 'token',
authorizationPrefix: 'JWT',
authorizationHeaderName: 'Authorization',
};