File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 28
28
29
29
#include " account.h"
30
30
#include " configfile.h" // ONLY ACCESS THE STATIC FUNCTIONS!
31
- #include " creds/httpcredentials.h"
31
+ #ifdef TOKEN_AUTH_ONLY
32
+ # include " creds/tokencredentials.h"
33
+ #else
34
+ # include " creds/httpcredentials.h"
35
+ #endif
32
36
#include " simplesslerrorhandler.h"
33
37
#include " syncengine.h"
34
38
#include " common/syncjournaldb.h"
@@ -130,6 +134,7 @@ QString queryPassword(const QString &user)
130
134
return QString::fromStdString (s);
131
135
}
132
136
137
+ #ifndef TOKEN_AUTH_ONLY
133
138
class HttpCredentialsText : public HttpCredentials
134
139
{
135
140
public:
@@ -161,6 +166,7 @@ class HttpCredentialsText : public HttpCredentials
161
166
private:
162
167
bool _sslTrusted;
163
168
};
169
+ #endif /* TOKEN_AUTH_ONLY */
164
170
165
171
void help ()
166
172
{
@@ -451,13 +457,18 @@ int main(int argc, char **argv)
451
457
452
458
SimpleSslErrorHandler *sslErrorHandler = new SimpleSslErrorHandler;
453
459
460
+ #ifdef TOKEN_AUTH_ONLY
461
+ TokenCredentials *cred = new TokenCredentials (user, password, " " );
462
+ account->setCredentials (cred);
463
+ #else
454
464
HttpCredentialsText *cred = new HttpCredentialsText (user, password);
455
-
465
+ account-> setCredentials (cred);
456
466
if (options.trustSSL ) {
457
467
cred->setSSLTrusted (true );
458
468
}
469
+ #endif
470
+
459
471
account->setUrl (url);
460
- account->setCredentials (cred);
461
472
account->setSslErrorHandler (sslErrorHandler);
462
473
463
474
// Perform a call to get the capabilities.
You can’t perform that action at this time.
0 commit comments