2021-04-12 15:21:57 +03:00
|
|
|
import UnauthenticatedRoute from 'ghost-admin/routes/unauthenticated';
|
2017-10-30 12:38:01 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2014-03-10 07:44:08 +04:00
|
|
|
|
2022-01-17 12:34:55 +03:00
|
|
|
export default class ResetRoute extends UnauthenticatedRoute {
|
|
|
|
@service notifications;
|
|
|
|
@service session;
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
beforeModel() {
|
2022-01-17 12:34:55 +03:00
|
|
|
if (this.session.isAuthenticated) {
|
2019-03-06 16:53:54 +03:00
|
|
|
this.notifications.showAlert('You can\'t reset your password while you\'re signed in.', {type: 'warn', delayed: true, key: 'password.reset.signed-in'});
|
2014-07-28 20:00:08 +04:00
|
|
|
}
|
2017-02-10 13:34:37 +03:00
|
|
|
|
2022-01-17 12:34:55 +03:00
|
|
|
super.beforeModel(...arguments);
|
|
|
|
}
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
setupController(controller, params) {
|
2014-03-31 13:57:50 +04:00
|
|
|
controller.token = params.token;
|
2022-01-17 12:34:55 +03:00
|
|
|
}
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2014-10-02 19:12:54 +04:00
|
|
|
// Clear out any sensitive information
|
2015-10-28 14:36:45 +03:00
|
|
|
deactivate() {
|
2022-01-17 12:34:55 +03:00
|
|
|
super.deactivate(...arguments);
|
2014-10-02 19:12:54 +04:00
|
|
|
this.controller.clearData();
|
2014-03-31 13:57:50 +04:00
|
|
|
}
|
2022-01-17 12:34:55 +03:00
|
|
|
}
|