user5487299
user5487299

Reputation:

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.

Upvotes: 0

Views: 190

Answers (2)

Andy Davison
Andy Davison

Reputation: 591

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!

Upvotes: 0

Henry Vonfire
Henry Vonfire

Reputation: 1281

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.

Upvotes: 0

Related Questions