From 4b713ece96a435f92589afcf89e3d93c37dfcbd8 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 20 Dec 2019 16:17:52 +0100 Subject: [PATCH] mobile UI/login: do not revert to old credentials. If the user asked to change credentials it is equivalent to a signout, so no need to store old credentials. This simplification allows removal of the temporary credentials in qmlPrefs. this commits secures the user is locked in the login page, until one of 3 things happen: - enter verified credentials (divelist is loaded from cloud) - select no-cloud mode (divelist is loaded from local) - enter new credentials, PIN page shows, enter PIN or cancel (back to enter credentials). This is consistent even if the program is restarted. Old version had a non consistent way: A user enters new credentials, sees the PIN screen, but does not receive the email immediately, so works with other applications (causing the mobile app to close) Having received the email with the PiN, the user starts mobile again, BUT does not see the PIN screen, instead the old credentials are used. Signed-off-by: Jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 7 ------- mobile-widgets/qmlprefs.cpp | 2 -- 2 files changed, 9 deletions(-) diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index b54a52b5e..3737f3357 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -244,13 +244,6 @@ Kirigami.ApplicationWindow { text: qsTr("Dive list") onTriggered: { manager.appendTextToLog("requested dive list with credential status " + prefs.credentialStatus) - if (prefs.credentialStatus == CloudStatus.CS_UNKNOWN) { - // the user has asked to change credentials - if the credentials before that - // were valid, go back to dive list - if (prefs.oldStatus == CloudStatus.CS_VERIFIED) { - prefs.credentialStatus = prefs.oldStatus - } - } returnTopPage() globalDrawer.close() } diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp index cf7b5ddbb..47caef005 100644 --- a/mobile-widgets/qmlprefs.cpp +++ b/mobile-widgets/qmlprefs.cpp @@ -132,8 +132,6 @@ void QMLPrefs::cancelCredentialsPinSetup() */ setCredentialStatus(qPrefCloudStorage::CS_UNKNOWN); - qPrefCloudStorage::set_cloud_storage_email(m_cloudUserName); - qPrefCloudStorage::set_cloud_storage_password(m_cloudPassword); qPrefCloudStorage::set_cloud_verification_status(m_credentialStatus); QMLManager::instance()->setStartPageText(tr("Starting..."));