Skip to content

Commit fca687c

Browse files
authored
fix auth-in-url (#576)
1 parent adc0742 commit fca687c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/client/sidebar-init.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Remove basic authentication in the URL, if any (to fix file attachments).
2+
if (Object.assign(document.createElement("a"), {href: ""}).password) location.replace(location.href);
3+
14
const sidebar = document.querySelector<HTMLElement>("#observablehq-sidebar")!;
25
const toggle = document.querySelector<HTMLInputElement>("#observablehq-sidebar-toggle")!;
36

0 commit comments

Comments
 (0)