Ember-simple-auth with ember-cli-simple-auth-token

Ember-simple-auth with ember-cli-simple-auth-token

我正在尝试将 ember-simple-auth 与 ember-cli-simple-auth-token 一起使用:

"ember-cli-simple-auth-token": "^0.7.3",
"ember-simple-auth": "1.0.1"

这是我的配置:

  ENV['simple-auth-token'] = {
    authorizer: 'simple-auth-authorizer:token',
    identificationField: 'email',
    serverTokenEndpoint: 'http://localhost:3000/token'
  };

我错过了什么吗?因为我在我的控制台中收到此错误:

Could not find module simple-auth/authenticators/base imported from simple-auth-token/authenticators/token

我已经尝试卸载和 npm prune,然后重新安装.. 并且不断显示相同的消息。

谢谢大家。

插件的名称是 ember-simple-auth,它正在寻找路径 simple-auth/authenticators/base,应该是 ember-simple-auth/authenticators/base。您应该更正文件 simple-auth-token/authenticators/token.

中的导入

否 - simple-auth-token 尚未更新。一些小的改动似乎让它重新开始,我会 post 给作者。

ember-simple-auth-token 模块所需的更改是:

1) app/initializers/simple-auth.js:

  • 将第 1 行的 "simple-auth" 更改为 "ember-simple-auth" 和
  • 删除(或注释掉)第 2 行和第 9 行(设置导入和调用

进行设置)。

2) addon/authenticators/token.js: 将第 2 行的 "simple-auth" 更改为 "ember-simple-auth"

3) addon/authorizers/token.js: 将第 2 行的 :simple-auth" 更改为 "ember-simple-auth"

希望这能帮助一些正在努力解决这个问题的人。

干杯!