Ember Simple Auth:"授权"已弃用



这是我的代码:

"ember-simple-auth": "^1.6.0"
"ember-cli": "^3.1.4"

export default ActiveModelAdapter.extend(DataAdapterMixin, {
host: ENV.APP.API_HOST,  
authorizer: 'authorizer:devise',
...

如何修复弃用警告?

我已经解决了这个问题。请参阅文档中的示例。

authorize(xhr) {
let { email, token } = this.get('session.data.authenticated');
let authData = `Token token="${token}", email="${email}"`;
xhr.setRequestHeader('Authorization', authData);
}

使用上面的代码而不是authorizer: 'authorizer:devise'

最新更新