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 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)