From b2e81b5d1780ef4cafaba3e83ece6c515d783d4c Mon Sep 17 00:00:00 2001 From: Andrew Darqui Date: Sun, 6 Oct 2013 04:24:38 -0400 Subject: [PATCH] Fixes a small issue with the redirect after logging in. If app.previousUrl is undefined (from accessing the page directly), login would fail to redirect you because of an error with indexOf on the undefined app.previousUrl. --- public/src/forum/login.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/forum/login.js b/public/src/forum/login.js index ed4e0753f6..96e6c49e94 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -35,6 +35,9 @@ define(function() { $('#login-error-notify').show(); } else { $('#login-error-notify').hide(); + + if(!app.previousUrl) { app.previousUrl = '/'; } + if(app.previousUrl.indexOf('/reset/') != -1) window.location.replace(RELATIVE_PATH + "/?loggedin"); else @@ -63,4 +66,4 @@ define(function() { }; return Login; -}); \ No newline at end of file +});