summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-08-22 00:42:40 +0200
committerPetr Mrázek <peterix@gmail.com>2015-08-22 00:42:40 +0200
commitc5bb33c7169c87fe17d030694938acd35f199947 (patch)
tree94ec7a158c80e8ad6cc1bc68f0bd79711e136560
parent40ed2654c7766857f8158e8d9744edc28ac0ef26 (diff)
downloadMultiMC-c5bb33c7169c87fe17d030694938acd35f199947.tar
MultiMC-c5bb33c7169c87fe17d030694938acd35f199947.tar.gz
MultiMC-c5bb33c7169c87fe17d030694938acd35f199947.tar.lz
MultiMC-c5bb33c7169c87fe17d030694938acd35f199947.tar.xz
MultiMC-c5bb33c7169c87fe17d030694938acd35f199947.zip
GH-1158 generate client uuid for yggdrasil auth
-rw-r--r--logic/auth/flows/AuthenticateTask.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/logic/auth/flows/AuthenticateTask.cpp b/logic/auth/flows/AuthenticateTask.cpp
index b26769d9..a609d28b 100644
--- a/logic/auth/flows/AuthenticateTask.cpp
+++ b/logic/auth/flows/AuthenticateTask.cpp
@@ -24,6 +24,7 @@
#include <QVariant>
#include <QDebug>
+#include <QUuid>
AuthenticateTask::AuthenticateTask(MojangAccount * account, const QString &password,
QObject *parent)
@@ -64,8 +65,14 @@ QJsonObject AuthenticateTask::getRequestContent() const
// If we already have a client token, give it to the server.
// Otherwise, let the server give us one.
- if (!m_account->m_clientToken.isEmpty())
- req.insert("clientToken", m_account->m_clientToken);
+
+ if(m_account->m_clientToken.isEmpty())
+ {
+ auto uuid = QUuid::createUuid();
+ auto uuidString = uuid.toString().remove('{').remove('-').remove('}');
+ m_account->m_clientToken = uuidString;
+ }
+ req.insert("clientToken", m_account->m_clientToken);
return req;
}