fix(files): support ?file= param as login-safe alternative to #hash
Hash fragments never reach the server so they're lost during login redirects. ?file= survives the ?next= flow; #hash still works for direct access when already logged in. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1807,10 +1807,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getPathFromURL() {
|
function getPathFromURL() {
|
||||||
|
// ?file= survives login redirects; #hash works when already logged in.
|
||||||
|
const qp = new URLSearchParams(window.location.search).get('file');
|
||||||
|
if (qp) return decodeURIComponent(qp);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
return hash ? decodeURIComponent(hash.slice(1)) : '';
|
return hash ? decodeURIComponent(hash.slice(1)) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('hashchange', () => loadPath(getPathFromURL()));
|
window.addEventListener('hashchange', () => loadPath(getPathFromURL()));
|
||||||
|
|
||||||
document.getElementById('codeEditor').addEventListener('input', function() {
|
document.getElementById('codeEditor').addEventListener('input', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user