fix(BRIDGE-107): improved human verification UX

This commit is contained in:
Atanas Janeshliev
2024-11-06 16:02:05 +01:00
parent f1aef383b7
commit 7d9753e2da
7 changed files with 34 additions and 7 deletions

View File

@ -30,7 +30,7 @@ using namespace bridgepp;
namespace {
QString const defaultKeychain = "defaultKeychain"; ///< The default keychain.
QString const HV_ERROR_TEMPLATE = "failed to create new API client: 422 POST https://mail-api.proton.me/auth/v4: CAPTCHA validation failed (Code=12087, Status=422)";
QString const HV_ERROR_TEMPLATE = "Human verification failed. Please try again.";
}

View File

@ -29,6 +29,7 @@ FocusScope {
property alias username: usernameTextField.text
property var wizard
property string hvLinkUrl: ""
property bool hvLinkClicked: false
signal loginAbort(string username, bool wasSignedOut)
@ -49,6 +50,7 @@ FocusScope {
}
passwordTextField.hidePassword();
secondPasswordTextField.hidePassword();
hvLinkClicked = false;
}
function resetViaHv() {
usernameTextField.enabled = false;
@ -56,6 +58,7 @@ FocusScope {
signInButton.loading = true;
secondPasswordButton.loading = false;
secondPasswordTextField.enabled = true;
hvLinkClicked = false;
totpLayout.reset();
}
@ -562,6 +565,7 @@ FocusScope {
cursorShape: Qt.PointingHandCursor
onClicked: {
Qt.openUrlExternally(hvLinkUrl);
hvLinkClicked = true;
}
}
}
@ -574,7 +578,8 @@ FocusScope {
id: hVContinueButton
Layout.fillWidth: true
colorScheme: wizard.colorScheme
text: qsTr("Continue")
text: qsTr("Ive completed the verification")
enabled: hvLinkClicked
function checkAndSignInHv() {
console.assert(stackLayout.currentIndex === Login.RootStack.HV || stackLayout.currentIndex === Login.RootStack.MailboxPassword, "Unexpected checkInAndSignInHv")