I am trying to have a user authenticated from code. I have a login form where users can login, and it works like charm.
However, when a new user sign up, and saves the form I would like to login them in in background when the form is valid.
How can I do that?
I found the following in the API at the authenticate() method:
For an application that works without an authentication route (e.g. because it opens a new window to handle authentication there), this is the method to override, e.g.:
App.ApplicationRoute = Ember.Route.extend(Ember.SimpleAuth.ApplicationRouteMixin, {
actions: {
authenticateSession: function() {
this.get('session').authenticate('app:authenticators:custom', {});
}
}
});
Do anyone know how to implement this. When I call this.get('session').authenticate() where to put the identication and password data?
Any hints or suggestions are highly appreciated!
Edit: maybe it is possible to use the same authenticator used for logging in instead of app:authenticators:custom as in the example?