From e21eb1c7b43c2c4ecd4452b60aa20e09b5f4f09f Mon Sep 17 00:00:00 2001 From: Jeremy Shimko Date: Wed, 30 Sep 2015 17:04:35 -0400 Subject: [PATCH] fix avoidRedirect bug --- lib/client/client.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/client.js b/lib/client/client.js index ee57273..c0152d2 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -60,7 +60,7 @@ AccountsTemplates.ensureSignedIn = function(context, redirect) { }); // redirect settings - AccountsTemplates.avoidDefaultRedirect = true; + AccountsTemplates.avoidRedirect = true; AccountsTemplates.avoidClearError = true; AccountsTemplates.redirectToPrevPath = true; @@ -93,7 +93,7 @@ AccountsTemplates.linkClick = function(route) { return; } var path = AccountsTemplates.getRoutePath(route); - if (path === '#' || path === FlowRouter.current().path) { + if (path === '#' || AccountsTemplates.avoidRedirect || path === FlowRouter.current().path) { AccountsTemplates.setState(route); } else { Meteor.defer(function() { @@ -124,8 +124,8 @@ AccountsTemplates.logout = function() { }; AccountsTemplates.postSubmitRedirect = function(route) { - if (AccountsTemplates.avoidDefaultRedirect) { - AccountsTemplates.avoidDefaultRedirect = false; + if (AccountsTemplates.avoidRedirect) { + AccountsTemplates.avoidRedirect = false; if (AccountsTemplates.redirectToPrevPath) { FlowRouter.redirect(AccountsTemplates.getPrevPath()); }