* Rocket.Chat: fix not working login with newer desktop clients

there were two problems:
1. Whatever URL you specify, the client removes the path and queries just /, our index.php now detects Rocket.Chat User-Agent header and redirects to /rocketchat/ in that case
2. our manifest.json an webworker registration was not using the individual webserver-URL but as static path
This commit is contained in:
Ralf Becker 2020-10-19 10:30:08 +02:00
parent 37be9f40d0
commit 910329c2e7
3 changed files with 10 additions and 2 deletions

View File

@ -77,7 +77,7 @@ egw_LAB.wait(function()
// register service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js', {scope:"/egroupware/"})
navigator.serviceWorker.register('./service-worker.js', {scope:egw_webserverUrl})
.then(function(registration) {
console.log('Registration successful, scope is:', registration.scope);
})

View File

@ -14,6 +14,14 @@ use EGroupware\Api;
use EGroupware\Api\Framework;
use EGroupware\Api\Egw;
// Rocket.Chat desktop clients ignore /rocketchat/ path in URL and use just /
// --> redirect them back to /rocketchat/
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Rocket.Chat') !== false)
{
header('Location: /rocketchat/');
exit;
}
// support of Mac or iPhone trying to autodetect CalDAV or CardDAV support
// if EGroupware is not installed in the docroot, you need either this code in the index.php there,
// or an uncoditional redirect to this file or copy groupdav.htaccess to your docroot as .htaccess

View File

@ -19,7 +19,7 @@
"start_url": "index.php",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/egroupware",
"scope": "/",
"theme_color": "#0073ae",
"serviceworker": {
"src": "/service-worker.js"