(js) follow requested URL after authentication
parent
ee7fdcba9f
commit
a65e96bdb5
2
NEWS
2
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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue