Skip to content

Commit

Permalink
allow disabling mojang auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Huskydog9988 committed Aug 12, 2023
1 parent 5862418 commit 4876f15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4876f15

Please sign in to comment.