samedi 20 juin 2015

How to make Ember Cli Mirage to work with Ember Simple auth

For development and testing I want to use Ember CLi Mirage. I'm trying to get it to work with simple auth. Simple auth is logging me in but right after that simple auth kicks me out and transfers me to the /login route. How do I have to set up Mirage to handle the session token?

This is what I'm doing so far:

import Ember from 'ember';

export default Ember.Controller.extend({

    actions: {
        authenticate() {
            var data = this.getProperties('username', 'password');
            this.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', data);
        }
    }

});

And in mirage I'm not sure how to set up my token route:

this.post('/token');




Aucun commentaire:

Enregistrer un commentaire