From 7e55ce6640b0e2a5ca1f66ece6f8ffa6201df0bc Mon Sep 17 00:00:00 2001 From: Gerhard Gappmeier Date: Fri, 9 Nov 2018 13:39:50 +0100 Subject: [PATCH] owncloudcmd: fix compiliation with TOKEN_AUTH_ONLY --- src/cmd/cmd.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 9ea2546bc..41d89f62b 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -28,7 +28,11 @@ #include "account.h" #include "configfile.h" // ONLY ACCESS THE STATIC FUNCTIONS! -#include "creds/httpcredentials.h" +#ifdef TOKEN_AUTH_ONLY +# include "creds/tokencredentials.h" +#else +# include "creds/httpcredentials.h" +#endif #include "simplesslerrorhandler.h" #include "syncengine.h" #include "common/syncjournaldb.h" @@ -128,6 +132,7 @@ QString queryPassword(const QString &user) return QString::fromStdString(s); } +#ifndef TOKEN_AUTH_ONLY class HttpCredentialsText : public HttpCredentials { public: @@ -159,6 +164,7 @@ public: private: bool _sslTrusted; }; +#endif /* TOKEN_AUTH_ONLY */ void help() { @@ -441,13 +447,18 @@ int main(int argc, char **argv) auto *sslErrorHandler = new SimpleSslErrorHandler; +#ifdef TOKEN_AUTH_ONLY + auto *cred = new TokenCredentials(user, password, ""); + account->setCredentials(cred); +#else auto *cred = new HttpCredentialsText(user, password); - + account->setCredentials(cred); if (options.trustSSL) { cred->setSSLTrusted(true); } +#endif + account->setUrl(url); - account->setCredentials(cred); account->setSslErrorHandler(sslErrorHandler); // Perform a call to get the capabilities. -- 2.30.2