0

I want to use the sessionAuthenticationSucceeded action in my applicationRoute, but somehow it doesn't fire.

I checked and found that the trigger is being called here, but it is not actually being triggered here, neither is my custom sessionAuthenticationSucceeded action in the applicationRoute. (I also tried calling _super and commenting my custom action altogether, to make sure the default mixin action was not overwritten).

I'm using ember-cli 0.1.4 and ember-simple-auth 0.7.2 in combination with the standard oauth2 authenticator. I'm a running a canary build of ember combined with HTMLBars. Signin works fine except that the sessionAuthenticationSucceeded is not triggered (might also be case for other action that I'm not aware of).

application route:

// app/pods/application/route.js
import Ember from 'ember';
import SimpleAuthApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';

export default Ember.Route.extend(SimpleAuthApplicationRouteMixin);

controller:

// app/pods/signin/controller.js
import Ember from 'ember';
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';

export default Ember.Controller.extend(LoginControllerMixin, {
  authenticator: 'simple-auth-authenticator:oauth2-password-grant'
});

signin template:

// app/pods/signin/template.hbs
<form {{action 'authenticate' on='submit'}}>
  {{input value=identification class="form-control" placeholder='Enter your email address' type='text'}}
  {{input value=password  class="form-control"  placeholder='Enter Password' type='password'}}
  <button type="submit" class="btn">Log in</button>
</form>
Timo
  • 187
  • 1
  • 8
  • Can you add more detail (configuration, used authenticator, authorizer etc., in which exact situation is the action not triggered)? – marcoow Dec 08 '14 at 08:23
  • also you're probably using ember-cli 0.1.4 as that's the latest version? – marcoow Dec 08 '14 at 09:23
  • I use the default setup as described in the docs. `SimpleAuthApplicationRouteMixin` `LoginControllerMixin` with `'simple-auth-authenticator:oauth2-password-grant'` as authenticator. Signing up works well. I do run a canary build of ember icw HTMLBars. – Timo Dec 08 '14 at 10:29
  • You really need to add as much detail as you can (code etc.) if you want people to help you. Also in what exact version is the action not triggered? – marcoow Dec 08 '14 at 14:01
  • I understand marcoow, I added more detail. I was hoping that the fact that I reverted back to the default setup, combined with stating that the trigger was called, but never reached the action, would ring some sort of bell : ) – Timo Dec 08 '14 at 19:18
  • Hm, looks good actually. Could you debug into the code here https://github.com/simplabs/ember-simple-auth/blob/master/packages/ember-simple-auth/lib/simple-auth/mixins/application-route-mixin.js#L90 and check that the action is actually being sent? – marcoow Dec 09 '14 at 07:46
  • @marcoow, As stated in my original question, I checked if the action was being send (the `here` links, perhaps a little obfuscated: ), it did get triggered but not actually called. It turned out to be the `beforeModel` hook in my `applicatioRoute` which was overwritten without calling `this._super()`. Thanks anyway. – Timo Dec 28 '14 at 16:55

0 Answers0