From 586241881840fee73fbd77fefa3d4610db7f95ec Mon Sep 17 00:00:00 2001 From: Husky <39809509+Huskydog9988@users.noreply.github.com> Date: Sat, 12 Aug 2023 15:42:15 -0400 Subject: [PATCH 1/2] Create .gitattributes --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5a0d5e48 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto eol=lf From 4876f150160da35e5d8a2a5af0c806d3e732433a Mon Sep 17 00:00:00 2001 From: Husky <39809509+Huskydog9988@users.noreply.github.com> Date: Sat, 12 Aug 2023 15:44:38 -0400 Subject: [PATCH 2/2] allow disabling mojang auth --- server/src/server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/server.ts b/server/src/server.ts index b2f38cec..ef4cfdf3 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -293,6 +293,11 @@ async function fetchHasJoined(args: { clientIp?: string }) { const { username, shaHex, clientIp } = args + + // if auth is disabled, return a "usable" item + if ('DISABLE_AUTH' in process.env) + return { name: username, uuid: `AUTH-DISABLED-${username}` } + let url = `https://sessionserver.mojang.com/session/minecraft/hasJoined?username=${username}&serverId=${shaHex}` if (clientIp) url += `&ip=${clientIp}` const res = await fetch(url)