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 <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
jan Iversen 2019-12-20 16:17:52 +01:00 committed by Dirk Hohndel
parent 9117aa2a52
commit 4b713ece96
2 changed files with 0 additions and 9 deletions

View file

@ -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()
}

View file

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