mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
71c358b638
No Issue - Switches to the newer style of dependency injection. - Instead of injection Controllers via "needs," use Ember.inject.controller(). - Get rid of initializers that were only injecting objects into various factories. Converts these objects into Ember.Service objects and declaratively inject them where needed via Ember.inject.service(). The added benefit to this is that it's no longer a mystery where these properties/methods come from and it's straightforward to inject them where needed.
27 lines
797 B
JavaScript
27 lines
797 B
JavaScript
import Ember from 'ember';
|
|
import Configuration from 'simple-auth/configuration';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
export default Ember.Route.extend(styleBody, {
|
|
classNames: ['ghost-reset'],
|
|
|
|
notifications: Ember.inject.service(),
|
|
|
|
beforeModel: function () {
|
|
if (this.get('session').isAuthenticated) {
|
|
this.get('notifications').showWarn('You can\'t reset your password while you\'re signed in.', {delayed: true});
|
|
this.transitionTo(Configuration.routeAfterAuthentication);
|
|
}
|
|
},
|
|
|
|
setupController: function (controller, params) {
|
|
controller.token = params.token;
|
|
},
|
|
|
|
// Clear out any sensitive information
|
|
deactivate: function () {
|
|
this._super();
|
|
this.controller.clearData();
|
|
}
|
|
});
|