Yeet logging into Microsoft with password

This has been broken for ages; we need to finally remove it.
This commit is contained in:
Camotoy 2022-09-15 15:53:03 -04:00
parent 27b948a09b
commit 83be01958f
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

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