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

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Weilbach <felix.weilbach@nextcloud.com>2021-10-08 18:00:10 +0300
committerFelix Weilbach <felix.weilbach@nextcloud.com>2021-10-18 13:20:20 +0300
commit24f6bc5203aff4f5d434c17685e1c94a9e1dd915 (patch)
tree02641c801a5b328e1382e7f93ddf0f8ab932f6b8 /src/libsync
parente5b3e9ed180ce1566438f727c1d9ec0d1d3bb9b5 (diff)
Only use basic authentication if needed
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/networkjobs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp
index 2800af0d6..96739c906 100644
--- a/src/libsync/networkjobs.cpp
+++ b/src/libsync/networkjobs.cpp
@@ -966,7 +966,10 @@ void DetermineAuthTypeJob::start()
oldFlowRequired->setIgnoreCredentialFailure(true);
connect(get, &SimpleNetworkJob::finishedSignal, this, [this, get]() {
- if (get->reply()->error() == QNetworkReply::AuthenticationRequiredError) {
+ const auto reply = get->reply();
+ const auto wwwAuthenticateHeader = reply->rawHeader("WWW-Authenticate");
+ if (reply->error() == QNetworkReply::AuthenticationRequiredError
+ && (wwwAuthenticateHeader.startsWith("Basic") || wwwAuthenticateHeader.startsWith("Bearer"))) {
_resultGet = Basic;
} else {
_resultGet = LoginFlowV2;