I don't understand how I'm supposed to include my custom authenticator and custom authorizor with ember cli.
Where to put it and what to include and how to do it. The cli example for simple-auth provided unfortunately does not cover custom authorizer and authenticator.
The build is successfully, but when running it in the browser, I get the error
TypeError: SimpleAuth.Authenticators is undefined
I'm aware that I'm doing something wrong, but could you please guide me or point me to the right documentation on how to do this, I can't 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);
//container.register('authorizer:custom', CustomAuthorizer);
}
};
My authenticator looks like this
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!
Change that to:
...
import Base from "simple-auth/authenticators/base";
export default Base.extend({
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With