[Pkg-owncloud-commits] [owncloud-client] 73/164: Token Auth: Allow empty token
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sun Mar 22 11:56:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit ec03ebd69fc461054bc96af2d86b82f9b629a518
Author: Markus Goetz <markus at woboq.com>
Date: Fri Feb 27 11:54:28 2015 +0100
Token Auth: Allow empty token
Just username/password. The received token will automatically be stored
inside the QNetworkCookieJar.
---
src/libsync/creds/tokencredentials.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/libsync/creds/tokencredentials.cpp b/src/libsync/creds/tokencredentials.cpp
index 8ef379a..eee692a 100644
--- a/src/libsync/creds/tokencredentials.cpp
+++ b/src/libsync/creds/tokencredentials.cpp
@@ -68,7 +68,6 @@ int getauth(const char *prompt,
return re;
}
-const char userC[] = "user";
const char authenticationFailedC[] = "owncloud-authentication-failed";
} // ns
@@ -80,8 +79,8 @@ public:
: AccessManager(parent), _cred(cred) {}
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
- if (_cred->user().isEmpty() || _cred->password().isEmpty() || _cred->_token.isEmpty()) {
- qWarning() << Q_FUNC_INFO << "Empty user/password/token provided!";
+ if (_cred->user().isEmpty() || _cred->password().isEmpty()) {
+ qWarning() << Q_FUNC_INFO << "Empty user/password provided!";
}
QNetworkRequest req(request);
@@ -91,7 +90,9 @@ protected:
// A pre-authenticated cookie
QByteArray token = _cred->_token.toUtf8();
- setRawCookie(token, request.url());
+ if (token.length() > 0) {
+ setRawCookie(token, request.url());
+ }
return AccessManager::createRequest(op, req, outgoingData);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list