2015-02-12 21:22:32 -07:00
|
|
|
import Ember from 'ember';
|
2014-03-09 23:44:08 -04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 23:18:23 -04:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-03-09 23:44:08 -04:00
|
|
|
|
2014-06-04 23:18:23 -04:00
|
|
|
var ResetRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
2014-03-31 11:57:50 +02:00
|
|
|
classNames: ['ghost-reset'],
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2014-07-28 18:00:08 +02:00
|
|
|
beforeModel: function () {
|
|
|
|
if (this.get('session').isAuthenticated) {
|
2014-10-24 21:09:50 +00:00
|
|
|
this.notifications.showWarn('You can\'t reset your password while you\'re signed in.', {delayed: true});
|
2014-07-28 18:00:08 +02:00
|
|
|
this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
|
|
|
|
}
|
|
|
|
},
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2014-03-31 11:57:50 +02:00
|
|
|
setupController: function (controller, params) {
|
|
|
|
controller.token = params.token;
|
2014-10-02 09:12:54 -06:00
|
|
|
},
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2014-10-02 09:12:54 -06:00
|
|
|
// Clear out any sensitive information
|
|
|
|
deactivate: function () {
|
|
|
|
this._super();
|
|
|
|
this.controller.clearData();
|
2014-03-31 11:57:50 +02:00
|
|
|
}
|
2014-03-09 23:44:08 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
export default ResetRoute;
|