1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 04:07:46 +00:00

Correct placement of String in right method

This commit is contained in:
Toofy 2023-01-15 16:39:36 +00:00 committed by Joshua Goins
parent 5dba0afed2
commit 04324554cd

View file

@ -10,10 +10,7 @@ SapphireLauncher::SapphireLauncher(LauncherCore& window) : window(window), QObje
void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& info) { void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& info) {
QJsonObject data{{"username", info.username}, {"pass", info.password}}; QJsonObject data{{"username", info.username}, {"pass", info.password}};
QUrl url; QUrl url(lobbyUrl + "/sapphire-api/lobby/login");
url.setScheme("http");
url.setHost(lobbyUrl);
url.setPath("/sapphire-api/lobby/login");
QNetworkRequest request(url); QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
@ -39,7 +36,7 @@ void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& in
void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInformation& info) { void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInformation& info) {
QJsonObject data{{"username", info.username}, {"pass", info.password}}; QJsonObject data{{"username", info.username}, {"pass", info.password}};
QUrl url(lobbyUrl + "/sapphire-api/lobby/login"); QUrl url(lobbyUrl + "/sapphire-api/lobby/createAccount");
QNetworkRequest request(url); QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");