desktop-login: Fix window.open invocation.

window.open expects a string, not a URL object.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-05-06 12:07:42 -07:00
committed by Tim Abbott
parent c20fdb0d8b
commit b079ba97ff

View File

@@ -47,12 +47,9 @@ async function decrypt_manual() {
const keyHex = Array.from(key, (b) => b.toString(16).padStart(2, "0")).join("");
window.open(
new URL(
(window.location.search ? window.location.search + "&" : "?") +
"desktop_flow_otp=" +
encodeURIComponent(keyHex),
window.location.href
),
(window.location.search ? window.location.search + "&" : "?") +
"desktop_flow_otp=" +
encodeURIComponent(keyHex),
"_blank"
);