lock minecraft account linking behind a flag

This commit is contained in:
hippoz 2022-02-25 19:57:39 +02:00
parent e18b6ee11d
commit fb721481e7
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -22,6 +22,7 @@ const messageTypes = {
READY: 2,
EVENT: 3
};
const EXPRIMENTAL_ACCOUNT_LINK = false;
const chatMessageRegex = /^\[(?:.*?)\]: \<(?<username>[a-zA-Z0-9]+)\> (?<message>.*)/;
const joinNotificationRegex = /^\[(?:.*?)\]: (?<username>[a-zA-Z0-9]+) joined the game/;
@ -263,7 +264,7 @@ async function main() {
const messageResult = chatMessageRegex.exec(stringData);
if (messageResult) {
if (messageResult.groups.message === "!:minecraft-link") {
if (EXPRIMENTAL_ACCOUNT_LINK && messageResult.groups.message === "!:minecraft-link") {
try {
const handoffToken = await startHandoffForUser(messageResult.groups.username);
const handoffLink = `${FRONTEND_ORIGIN}#token_handoff,,${handoffToken}`;