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
|
|
|
|
2021-04-12 15:21:57 +03:00
|
|
|
export default UnauthenticatedRoute.extend({
|
2017-10-30 12:38:01 +03:00
|
|
|
notifications: service(),
|
|
|
|
session: service(),
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
beforeModel() {
|
2015-10-18 21:17:02 +03:00
|
|
|
if (this.get('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
|
|
|
|
|
|
|
this._super(...arguments);
|
2014-07-28 20:00:08 +04:00
|
|
|
},
|
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;
|
2014-10-02 19:12:54 +04: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() {
|
|
|
|
this._super(...arguments);
|
2014-10-02 19:12:54 +04:00
|
|
|
this.controller.clearData();
|
2014-03-31 13:57:50 +04:00
|
|
|
}
|
2014-03-10 07:44:08 +04:00
|
|
|
});
|