From 0fa8b449b21d2e2d5875c8300b86e8f7740f7598 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 21 Nov 2014 15:35:14 +0100 Subject: [PATCH] Use `/` as redirect location if webroot is set to an empty value If the webroot has been set to an empty value or ownCloud has been installed at the root location (`/``) there is a fair chance that the redirect for password resets does not work at all. This means that while the password is getting resetted the user is not redirected to the login page. I'm aware that it might be better to just set the webroot to `/` in those cases but this patch is better in the regard that it cannot break stuff. Thanks to @PVince81 for helping me debugging this. (I'm a moron and assumed it couldn't be THAT easy) Reported by @cdamken --- core/js/lostpassword.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js index 35173fd3d3..294a9d8c1c 100644 --- a/core/js/lostpassword.js +++ b/core/js/lostpassword.js @@ -112,7 +112,11 @@ OC.Lostpassword = { }, redirect : function(msg){ - window.location = OC.webroot; + if(OC.webroot !== '') { + window.location = OC.webroot; + } else { + window.location = '/'; + } }, resetError : function(msg){