diff --git a/NEWS b/NEWS index 549ee3754..6707f9108 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,7 @@ New features - [web] register SOGo as a handler for the mailto scheme (#1223) Enhancements - - + - [web] follow requested URL after user authentication Bug fixes - [core] yearly repeating events are not shown in web calendar (#4237) diff --git a/UI/WebServerResources/js/Common/Authentication.service.js b/UI/WebServerResources/js/Common/Authentication.service.js index a4c304ba4..100b3ccbc 100644 --- a/UI/WebServerResources/js/Common/Authentication.service.js +++ b/UI/WebServerResources/js/Common/Authentication.service.js @@ -27,29 +27,23 @@ function Authentication() { function redirectUrl(username, domain) { - var userName, address, baseAddress, altBaseAddress, parts, hostpart, protocol, newAddress; + var userName, address, baseAddress, parts, hostpart, protocol, newAddress; userName = username; if (domain) userName += '@' + domain.value; address = '' + window.location.href; - baseAddress = ApplicationBaseURL + '/' + encodeURIComponent(userName); + baseAddress = ApplicationBaseURL + encodeURIComponent(userName); if (baseAddress[0] == '/') { parts = address.split('/'); hostpart = parts[2]; protocol = parts[0]; baseAddress = protocol + '//' + hostpart + baseAddress; } - parts = baseAddress.split('/'); - parts.splice(0, 3); - altBaseAddress = parts.join('/'); - if ((address.startsWith(baseAddress) || address.startsWith(altBaseAddress)) && - !address.endsWith('/logoff')) { + if (address.startsWith(baseAddress) && !address.endsWith('/logoff')) newAddress = address; - } - else { + else newAddress = baseAddress; - } return newAddress; } @@ -124,7 +118,7 @@ } } else { - d.resolve(redirectUrl(username, domain)); + d.resolve({ url: redirectUrl(username, domain) }); } } }, function(response) {