summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r--api/logic/minecraft/auth/MojangAccount.cpp6
-rw-r--r--api/logic/minecraft/auth/MojangAccount.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/api/logic/minecraft/auth/MojangAccount.cpp b/api/logic/minecraft/auth/MojangAccount.cpp
index 2b073aac..e6247608 100644
--- a/api/logic/minecraft/auth/MojangAccount.cpp
+++ b/api/logic/minecraft/auth/MojangAccount.cpp
@@ -298,3 +298,9 @@ void MojangAccount::incrementUses()
qWarning() << "Account" << m_username << "is now in use.";
}
}
+
+void MojangAccount::invalidateClientToken()
+{
+ m_clientToken = QUuid::createUuid().toString().remove(QRegExp("[{}-]"));
+ emit changed();
+}
diff --git a/api/logic/minecraft/auth/MojangAccount.h b/api/logic/minecraft/auth/MojangAccount.h
index 4902ec11..86d81c63 100644
--- a/api/logic/minecraft/auth/MojangAccount.h
+++ b/api/logic/minecraft/auth/MojangAccount.h
@@ -95,8 +95,8 @@ public: /* manipulation */
* Attempt to login. Empty password means we use the token.
* If the attempt fails because we already are performing some task, it returns false.
*/
- std::shared_ptr<YggdrasilTask> login(AuthSessionPtr session,
- QString password = QString());
+ std::shared_ptr<YggdrasilTask> login(AuthSessionPtr session, QString password = QString());
+ void invalidateClientToken();
public: /* queries */
const QString &username() const