From ab1099f13e7c402450350ae9c0df244cd89e9e27 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Tue, 3 Mar 2020 06:01:27 +0100 Subject: [PATCH] WebFlowCredentials: Make username comparison case-insensitive (fix #1741) Fixes issue #1741 Signed-off-by: Michael Schuster --- src/gui/creds/webflowcredentials.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp index 4993a0dd0..fb85fc5d2 100644 --- a/src/gui/creds/webflowcredentials.cpp +++ b/src/gui/creds/webflowcredentials.cpp @@ -183,7 +183,11 @@ void WebFlowCredentials::askFromUser() { void WebFlowCredentials::slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host) { Q_UNUSED(host) - if (_user != user) { + // Compare the re-entered username case-insensitive and save the new value (avoid breaking the account) + // See issue: https://github.com/nextcloud/desktop/issues/1741 + if (QString::compare(_user, user, Qt::CaseInsensitive) == 0) { + _user = user; + } else { qCInfo(lcWebFlowCredentials()) << "Authed with the wrong user!"; QString msg = tr("Please login with the user: %1")