3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01: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 (isPasswordAuthEnabled) {
session.setMicrosoftAccount(true);
buildAndShowMicrosoftAuthenticationWindow(session);
} else {
// Just show the OAuth code
session.authenticateWithMicrosoftCode();
}
session.authenticateWithMicrosoftCode();
return;
}
@ -315,39 +309,10 @@ public class LoginEncryptionUtils {
.input("geyser.auth.login.form.details.email", "account@geysermc.org", "")
.input("geyser.auth.login.form.details.pass", "123456", "")
.invalidResultHandler(() -> buildAndShowLoginDetailsWindow(session))
.closedResultHandler(() -> {
if (session.isMicrosoftAccount()) {
buildAndShowMicrosoftAuthenticationWindow(session);
} else {
buildAndShowLoginWindow(session);
}
})
.closedResultHandler(() -> buildAndShowLoginWindow(session))
.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
*/
@ -374,7 +339,7 @@ public class LoginEncryptionUtils {
.content(message.toString())
.button1("%gui.done")
.button2("%menu.disconnect")
.closedOrInvalidResultHandler(() -> buildAndShowMicrosoftAuthenticationWindow(session))
.closedOrInvalidResultHandler(() -> buildAndShowLoginWindow(session))
.validResultHandler((response) -> {
if (response.clickedButtonId() == 1) {
session.disconnect(GeyserLocale.getPlayerLocaleString("geyser.auth.login.form.disconnect", locale));