1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-22 04:37:46 +00:00

Don't allow manually inputting a OTP when they're auto-generated

(cherry picked from commit dfe0803d76)
This commit is contained in:
Joshua Goins 2024-08-04 22:43:32 -04:00
parent 5af0c46b2a
commit bf72ee6633

View file

@ -64,15 +64,10 @@ QQC2.Control {
console.info(!LauncherCore.currentProfile.account.needsPassword && LauncherCore.currentProfile.account.rememberPassword); console.info(!LauncherCore.currentProfile.account.needsPassword && LauncherCore.currentProfile.account.rememberPassword);
usernameField.text = LauncherCore.currentProfile.account.name; usernameField.text = LauncherCore.currentProfile.account.name;
passwordField.text = !LauncherCore.currentProfile.account.needsPassword && LauncherCore.currentProfile.account.rememberPassword ? LauncherCore.currentProfile.account.getPassword() : ""; passwordField.text = !LauncherCore.currentProfile.account.needsPassword && LauncherCore.currentProfile.account.rememberPassword ? LauncherCore.currentProfile.account.getPassword() : "";
otpField.text = ""; if (LauncherCore.currentProfile.account.rememberOTP) {
} otpField.text = "Auto-generated";
} else {
Connections { otpField.text = "";
target: LauncherCore
function onCurrentProfileChanged() {
page.updateFields();
LauncherCore.refreshLogoImage();
} }
} }
@ -252,6 +247,8 @@ QQC2.Control {
FormCard.FormTextFieldDelegate { FormCard.FormTextFieldDelegate {
id: otpField id: otpField
enabled: !LauncherCore.currentProfile.account.rememberOTP
label: i18n("One-time Password") label: i18n("One-time Password")
visible: LauncherCore.currentProfile.account.useOTP visible: LauncherCore.currentProfile.account.useOTP
onAccepted: { onAccepted: {