mirror of
https://github.com/UltimMC/Launcher.git
synced 2026-01-03 06:10:03 +00:00
Dehardcode account providers (#38)
* Dehardcode account providers * Fix crash on creation * Add dynamic 'add account dialog' provider selector * Fix typo and add newlines * Rename loginType to provider * Rename MojangAccount to Account and MojangAccountList to AccountList * Fix json save error
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "YggdrasilTask.h"
|
||||
#include "MojangAccount.h"
|
||||
#include "Account.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
YggdrasilTask::YggdrasilTask(MojangAccount *account, QObject *parent)
|
||||
YggdrasilTask::YggdrasilTask(Account *account, QObject *parent)
|
||||
: Task(parent), m_account(account)
|
||||
{
|
||||
changeState(STATE_CREATED);
|
||||
@@ -40,9 +40,8 @@ void YggdrasilTask::executeTask()
|
||||
// Get the content of the request we're going to send to the server.
|
||||
QJsonDocument doc(getRequestContent());
|
||||
|
||||
QUrl reqUrl(m_account->authEndpoint() + getEndpoint());
|
||||
qDebug() << m_account->authEndpoint() + getEndpoint();
|
||||
QNetworkRequest netRequest(reqUrl);
|
||||
QUrl reqUrl(m_account->provider()->authEndpoint() + getEndpoint());
|
||||
QNetworkRequest netRequest(reqUrl);
|
||||
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QByteArray requestData = doc.toJson();
|
||||
|
||||
Reference in New Issue
Block a user