From b3112a4349ca5dc6179ba795874ec36e23a2163b Mon Sep 17 00:00:00 2001 From: Sebastian Gierlinger Date: Mon, 28 Jul 2014 18:00:08 +0200 Subject: [PATCH] Reset/Signin while signed in no issue - added redirect and notification to reset route - added notification to signup route --- core/client/routes/reset.js | 6 ++++++ core/client/routes/signup.js | 1 + 2 files changed, 7 insertions(+) diff --git a/core/client/routes/reset.js b/core/client/routes/reset.js index c938105cdc..ad32957406 100644 --- a/core/client/routes/reset.js +++ b/core/client/routes/reset.js @@ -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; } diff --git a/core/client/routes/signup.js b/core/client/routes/signup.js index d6930a4779..0801a15b56 100644 --- a/core/client/routes/signup.js +++ b/core/client/routes/signup.js @@ -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); } },