Merge pull request #3440 from sebgie/notification-reset-invite

Reset/Signin while signed in
This commit is contained in:
Hannah Wolfe 2014-07-29 11:52:40 +01:00
commit b6d7afe9ad
2 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,12 @@ import loadingIndicator from 'ghost/mixins/loading-indicator';
var ResetRoute = Ember.Route.extend(styleBody, loadingIndicator, {
classNames: ['ghost-reset'],
beforeModel: function () {
if (this.get('session').isAuthenticated) {
this.notifications.showWarn('You can\'t reset your password while you\'re signed in.', true);
this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
}
},
setupController: function (controller, params) {
controller.token = params.token;
}

View File

@ -5,6 +5,7 @@ var SignupRoute = Ember.Route.extend(styleBody, loadingIndicator, {
classNames: ['ghost-signup'],
beforeModel: function () {
if (this.get('session').isAuthenticated) {
this.notifications.showWarn('You need to sign out to register as a new user.', true);
this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
}
},