Wizard: Find user:pw even if redirected #4265
authorChristian Kamm <mail@ckamm.de>
Wed, 9 Dec 2015 13:45:50 +0000 (14:45 +0100)
committerChristian Kamm <mail@ckamm.de>
Wed, 9 Dec 2015 13:48:51 +0000 (14:48 +0100)
src/gui/wizard/owncloudhttpcredspage.cpp

index 09f05f9ef5e4c69dd93fd6e382b8647baada6763..30d83917d6672bd3b26410fee024ea786295709a 100644 (file)
@@ -81,6 +81,13 @@ void OwncloudHttpCredsPage::initializePage()
     } else {
         QUrl url = ocWizard->account()->url();
 
+        // If the final url does not have a username, check the
+        // user specified url too. Sometimes redirects can lose
+        // the user:pw information.
+        if (url.userName().isEmpty()) {
+            url = ocWizard->ocUrl();
+        }
+
         const QString user = url.userName();
         const QString password = url.password();