I do not understand how I should include my own authenticator and user authorizer with ember cli.
Where to put it and what to include and how to do it. Unfortunately, the cli example for simple auth does not apply to the user authorizer and authenticator.
The build is successful, but when I start in the browser I get an error
TypeError: SimpleAuth.Authenticators is undefined
I know that I am doing something wrong, but could you advise me or show me the correct documentation on how to do this, I can not find anything :( My initializer looks like this:
import Ember from 'ember'; import CustomAuthenticator from "../models/customauthenticator"; export default { name : 'authentication', before : 'simple-auth', initialize : function(container) { container.register('authenticator:custom', CustomAuthenticator);
My authenticator is as follows
import Ember from "ember"; import App from '../app'; import SimpleAuth from "simple-auth/authenticators/base"; App.CustomAuthenticator = SimpleAuth.Authenticators.Base.extend({ tokenEndpoint: '/api/RestUser.php/users/core/access/', restore: function(data) { [...] }, authenticate: function(credentials) { [...] }, invalidate: function() { [...] } });
What am I missing? Thanks in advance!
source share