I'm trying to make use of _super in the handler of a Promise inside of a Controller action, but it doesn't work because it seems to lose the correct chain of functions.
ApplicationRoute = Ember.Route.extend SimpleAuth.ApplicationRouteMixin,
actions:
sessionAuthenticationSucceeded: ->
@get("session.user").then (user) =>
if @get("session.isTemporaryPassword") or not user.get "lastLogin"
@transitionTo "temp-password"
else
@_super()
I want to revert to the Mixin's default behavior on the else
but I need to resolve user
asynchronously before I can do a conditional statement. I tried:
ApplicationRoute = Ember.Route.extend SimpleAuth.ApplicationRouteMixin,
actions:
sessionAuthenticationSucceeded: ->
_super = @_super
@get("session.user").then (user) =>
if @get("session.isTemporaryPassword") or not user.get "lastLogin"
@transitionTo "temp-password"
else
_super()
and
ApplicationRoute = Ember.Route.extend SimpleAuth.ApplicationRouteMixin,
actions:
sessionAuthenticationSucceeded: ->
@get("session.user").then (user) =>
if @get("session.isTemporaryPassword") or not user.get "lastLogin"
@transitionTo "temp-password"
else
@_super.bind(@)()
Neither works.
This answer claimed this should work as of 1.5.0, but I'm using 1.7.0-beta.5 and it's no go. Is there a way to get this to work, even in terms of approaching this differently?