简体   繁体   中英

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

I'm trying to use ember-simple-auth with ember-cli-simple-auth-token:

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

And that's my configurations:

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

Am i missing something? Cause i'm receiving this error in my console:

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

I already try to uninstall and npm prune, and reinstall.. and the same message keeps showing.

Thanks guys.

The name of the addon is ember-simple-auth and it's looking for a path simple-auth/authenticators/base which should be ember-simple-auth/authenticators/base . You should correct that import in the file simple-auth-token/authenticators/token .

No - simple-auth-token hasn't been updated as yet. A couple of minor changes seems to get it going again, which I will post to the author.

The changes in the ember-simple-auth-token module required are:

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

  • change "simple-auth" on line 1 to "ember-simple-auth" and
  • remove (or comment out) lines 2 and 9 (the import for setup, and the call

to setup).

2) addon/authenticators/token.js: change "simple-auth" on line 2 to "ember-simple-auth"

3) addon/authorizers/token.js: change :simple-auth" on line 2 to "ember-simple-auth"

Hopefully that helps a few people out there struggling with this.

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM