Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2022-06-23 13:56:16 +0300
committerHannah von Reth <vonreth@kde.org>2022-06-29 16:58:28 +0300
commit67ff79e412e9d47d96356cd46e519b9c030c0f43 (patch)
tree72aa26c94776456361f415f78f973aed2922ee84 /src/libsync
parentdf4a2f10eed62570aec479a6737cae68fc89b98f (diff)
Oauth: case insensitive username compare
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/creds/oauth.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsync/creds/oauth.cpp b/src/libsync/creds/oauth.cpp
index 28ae21744..ef6f6259d 100644
--- a/src/libsync/creds/oauth.cpp
+++ b/src/libsync/creds/oauth.cpp
@@ -381,7 +381,8 @@ void OAuth::refreshAuthentication(const QString &refreshToken)
void OAuth::finalize(const QPointer<QTcpSocket> &socket, const QString &accessToken,
const QString &refreshToken, const QString &user, const QUrl &messageUrl)
{
- if (!_account->davUser().isNull() && user != _account->davUser()) {
+ // dav user names are case insensetive, we might compare a user input with the string provided by the server
+ if (!_account->davUser().isEmpty() && user.compare(_account->davUser(), Qt::CaseInsensitive) != 0) {
// Connected with the wrong user
qCWarning(lcOauth) << "We expected the user" << _account->davUser() << "but the server answered with user" << user;
const QString message = tr("<h1>Wrong user</h1>"