From 4b713ece96a435f92589afcf89e3d93c37dfcbd8 Mon Sep 17 00:00:00 2001
From: jan Iversen <jan@casacondor.com>
Date: Fri, 20 Dec 2019 16:17:52 +0100
Subject: 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>
---
 mobile-widgets/qml/main.qml | 7 -------
 1 file changed, 7 deletions(-)

(limited to 'mobile-widgets/qml')

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()
 				}
-- 
cgit v1.2.3-70-g09d2