#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"
return QString::fromStdString(s);
}
+#ifndef TOKEN_AUTH_ONLY
class HttpCredentialsText : public HttpCredentials
{
public:
private:
bool _sslTrusted;
};
+#endif /* TOKEN_AUTH_ONLY */
void help()
{
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.