Commit 76639f71 authored by Jan Koester's avatar Jan Koester
Browse files

editor: ?document= nach der Anmeldung beibehalten

Unangemeldete Aufrufe von /?document=<id> bekommen login.html an Ort und
Stelle; nach dem Login ging es bisher auf die Basisadresse ohne Parameter,
so dass das verlinkte Dokument nie geoeffnet wurde.

Co-Authored-By: default avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 7d57a926
Loading
Loading
Loading
Loading
+6 −1
Changes for editor/html/login.html: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -209,7 +209,12 @@
                if (xhr.status === 200) {
                    // Navigate to the mount root (the <base href>), not the
                    // domain root, so we stay inside the /editor prefix.
                    window.location.href = document.baseURI;
                    // Keep a deep link (?document=<id>): the server serves this page in
                    // place of index.html for unauthenticated requests to /?document=...
                    var next = document.baseURI.split('?')[0].split('#')[0], docId = '';
                    try { docId = new URLSearchParams(location.search).get('document') || ''; } catch(ex) {}
                    if (/^[A-Za-z0-9_-]{1,128}$/.test(docId)) next += '?document=' + encodeURIComponent(docId);
                    window.location.href = next;
                } else {
                    try {
                        var resp = JSON.parse(xhr.responseText);