mardi 1 décembre 2015

ember-simple-auth overriding sessionAuthenticated

Folks,

I've been trying to get ESA to redirect to specific pages after login and logout events without success.

I'm trying to do this by overriding the "sessionAuthenticated" method, but have also tried setting the "routeAfterConfiguration" setting with no luck.

At the moment, login sends me to "/", and logout sends the app to "/undefined".

The code for my application route looks like this...

import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';

export default Ember.Route.extend(ApplicationRouteMixin,{
    actions: {
      sessionAuthenticated: function() {
         console.log('sessionAuthenticated: authentications ok');
         window.location.replace('/profile');
     },
   },
});

Does anyone have any idea what I might be doing wrong here?

Cheers,

Andy




Aucun commentaire:

Enregistrer un commentaire