2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2015-05-13 08:27:59 +03:00
|
|
|
import Configuration from 'simple-auth/configuration';
|
2014-03-10 07:44:08 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2015-05-26 05:10:50 +03:00
|
|
|
export default Ember.Route.extend(styleBody, {
|
2014-03-31 13:57:50 +04:00
|
|
|
classNames: ['ghost-reset'],
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2015-05-26 05:10:50 +03:00
|
|
|
notifications: Ember.inject.service(),
|
|
|
|
|
2014-07-28 20:00:08 +04:00
|
|
|
beforeModel: function () {
|
|
|
|
if (this.get('session').isAuthenticated) {
|
2015-05-26 05:10:50 +03:00
|
|
|
this.get('notifications').showWarn('You can\'t reset your password while you\'re signed in.', {delayed: true});
|
2015-05-13 08:27:59 +03:00
|
|
|
this.transitionTo(Configuration.routeAfterAuthentication);
|
2014-07-28 20:00:08 +04:00
|
|
|
}
|
|
|
|
},
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2014-03-31 13:57:50 +04:00
|
|
|
setupController: function (controller, params) {
|
|
|
|
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
|
|
|
|
deactivate: function () {
|
|
|
|
this._super();
|
|
|
|
this.controller.clearData();
|
2014-03-31 13:57:50 +04:00
|
|
|
}
|
2014-03-10 07:44:08 +04:00
|
|
|
});
|