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
This commit is contained in:
Lukas Reschke 2014-11-21 15:35:14 +01:00
parent 13b06aa6df
commit 0fa8b449b2
1 changed files with 5 additions and 1 deletions

View File

@ -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){