mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
983110d931
no issue - add eslint-plugin-ember, configure no-old-shims rule - run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports - further cleanup of Ember globals usage - remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
30 lines
943 B
JavaScript
30 lines
943 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 injectService} from '@ember/service';
|
|
|
|
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
|
|
classNames: ['ghost-reset'],
|
|
|
|
notifications: injectService(),
|
|
session: injectService(),
|
|
|
|
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();
|
|
}
|
|
});
|