From a99ada3d185865a181a9e36d457a02dd94ce0989 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Sun, 13 Dec 2020 19:04:19 -0300 Subject: [PATCH] Use hash in minecraft.id redirect URL --- src/main/resources/web/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/web/auth.js b/src/main/resources/web/auth.js index 8a1cff3..9d7fdb5 100644 --- a/src/main/resources/web/auth.js +++ b/src/main/resources/web/auth.js @@ -1,6 +1,6 @@ $(() => { let urlParams = new URLSearchParams(); - window.location.search.split("?").map(it => new URLSearchParams(it).forEach((a, b) => urlParams.append(b, a))); + window.location.hash.split("?").map(it => new URLSearchParams(it).forEach((a, b) => urlParams.append(b, a))); var username = urlParams.get("username"); var mcauth_code = urlParams.get("mcauth_code"); if (urlParams.get("mcauth_success") == "false") { @@ -189,7 +189,7 @@ $(() => { link.href = "javascript:"; link.onclick = () => { let user = prompt("Username (Minecraft.ID is case-sensitive): ", ""); - let callbackUrl = new URL(location.origin + location.pathname + "?username=" + encodeURIComponent(user)); + let callbackUrl = new URL(location.origin + location.pathname + "#username=" + encodeURIComponent(user)); location = "https://api.minecraft.id/gateway/start/" + encodeURIComponent(user) + "?callback=" + encodeURIComponent(callbackUrl); }; content.appendChild(p);