3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-09-08 12:32:53 +02:00

Yeet logging into Microsoft with password

This has been broken for ages; we need to finally remove it.
Dieser Commit ist enthalten in:
Camotoy 2022-09-15 15:53:03 -04:00
Ursprung 27b948a09b
Commit 83be01958f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -245,13 +245,7 @@ public class LoginEncryptionUtils {
} }
if (response.clickedButtonId() == 1) { if (response.clickedButtonId() == 1) {
if (isPasswordAuthEnabled) { session.authenticateWithMicrosoftCode();
session.setMicrosoftAccount(true);
buildAndShowMicrosoftAuthenticationWindow(session);
} else {
// Just show the OAuth code
session.authenticateWithMicrosoftCode();
}
return; return;
} }
@ -315,39 +309,10 @@ public class LoginEncryptionUtils {
.input("geyser.auth.login.form.details.email", "account@geysermc.org", "") .input("geyser.auth.login.form.details.email", "account@geysermc.org", "")
.input("geyser.auth.login.form.details.pass", "123456", "") .input("geyser.auth.login.form.details.pass", "123456", "")
.invalidResultHandler(() -> buildAndShowLoginDetailsWindow(session)) .invalidResultHandler(() -> buildAndShowLoginDetailsWindow(session))
.closedResultHandler(() -> { .closedResultHandler(() -> buildAndShowLoginWindow(session))
if (session.isMicrosoftAccount()) {
buildAndShowMicrosoftAuthenticationWindow(session);
} else {
buildAndShowLoginWindow(session);
}
})
.validResultHandler((response) -> session.authenticate(response.next(), response.next()))); .validResultHandler((response) -> session.authenticate(response.next(), response.next())));
} }
/**
* Prompts the user between either OAuth code login or manual password authentication
*/
public static void buildAndShowMicrosoftAuthenticationWindow(GeyserSession session) {
session.sendForm(
SimpleForm.builder()
.translator(GeyserLocale::getPlayerLocaleString, session.locale())
.title("geyser.auth.login.form.notice.btn_login.microsoft")
.button("geyser.auth.login.method.browser")
.button("geyser.auth.login.method.password")
.button("geyser.auth.login.form.notice.btn_disconnect")
.closedOrInvalidResultHandler(() -> buildAndShowLoginWindow(session))
.validResultHandler((response) -> {
if (response.clickedButtonId() == 0) {
session.authenticateWithMicrosoftCode();
} else if (response.clickedButtonId() == 1) {
buildAndShowLoginDetailsWindow(session);
} else {
session.disconnect(GeyserLocale.getPlayerLocaleString("geyser.auth.login.form.disconnect", session.locale()));
}
}));
}
/** /**
* Shows the code that a user must input into their browser * Shows the code that a user must input into their browser
*/ */
@ -374,7 +339,7 @@ public class LoginEncryptionUtils {
.content(message.toString()) .content(message.toString())
.button1("%gui.done") .button1("%gui.done")
.button2("%menu.disconnect") .button2("%menu.disconnect")
.closedOrInvalidResultHandler(() -> buildAndShowMicrosoftAuthenticationWindow(session)) .closedOrInvalidResultHandler(() -> buildAndShowLoginWindow(session))
.validResultHandler((response) -> { .validResultHandler((response) -> {
if (response.clickedButtonId() == 1) { if (response.clickedButtonId() == 1) {
session.disconnect(GeyserLocale.getPlayerLocaleString("geyser.auth.login.form.disconnect", locale)); session.disconnect(GeyserLocale.getPlayerLocaleString("geyser.auth.login.form.disconnect", locale));