mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
9adbcd1fd0
no issue Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
30 lines
925 B
JavaScript
30 lines
925 B
JavaScript
import Route from '@ember/routing/route';
|
|
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
|
|
classNames: ['ghost-reset'],
|
|
|
|
notifications: service(),
|
|
session: service(),
|
|
|
|
beforeModel() {
|
|
if (this.get('session.isAuthenticated')) {
|
|
this.get('notifications').showAlert('You can\'t reset your password while you\'re signed in.', {type: 'warn', delayed: true, key: 'password.reset.signed-in'});
|
|
}
|
|
|
|
this._super(...arguments);
|
|
},
|
|
|
|
setupController(controller, params) {
|
|
controller.token = params.token;
|
|
},
|
|
|
|
// Clear out any sensitive information
|
|
deactivate() {
|
|
this._super(...arguments);
|
|
this.controller.clearData();
|
|
}
|
|
});
|