jeudi 22 octobre 2015

How to use devise token to manually create session using ember-simple-auth 1.0

I have an app that uses ember-simple-auth with the Devise authorizer.

When I was on ember-simple-auth v 0.7.x I was able to create a new user model and save it. Then in the success response, use a devise token returned from the serve to manually authorize the session like...

neweUser.save().then(function(user) {
    var authData = {
        user_token: user.get('authenticationToken'),
        token: user.get('authenticationToken'),
        user_email: user.get('email'),
        email: user.get('email'),
        user_id: user.get('id'),
        user: user
    };

    this.get('session').setup(authenticator, authData, true);
}

but now with ember-simple-auth 1.0, there doesn't seem to be a setup() method on the session service. am i missing something? any ideas how to manually authorize a session using the devise token?




Aucun commentaire:

Enregistrer un commentaire