username and password is now transmitted as bas64

This commit is contained in:
Dorian Zedler 2020-01-25 11:13:32 +01:00
parent a3c24d782c
commit 0268983d85

View file

@ -64,10 +64,17 @@ ServerConn::ServerConn(QObject *parent) : QObject(parent)
int ServerConn::login(QString username, QString password, bool permanent) int ServerConn::login(QString username, QString password, bool permanent)
{ {
// send the request // prepare URL
QVariantMap ret = this->senddata(QUrl("https://www.fanny-leicht.de/j34/index.php/component/fannysubstitutionplan?task=api_login&username=" + username + "&password=" + password));
qDebug() << ret; QByteArray usernameByteArray = username.toUtf8();
QByteArray passwordByteArray = password.toUtf8();
QString url =
"https://www.fanny-leicht.de/j34/index.php/component/fannysubstitutionplan?task=api_login&username=" +
usernameByteArray.toBase64() + "&password=" + passwordByteArray.toBase64() + "&loginIsBase64=true";
qDebug() << url;
// send the request
QVariantMap ret = this->senddata(QUrl(url));
if(ret["status"].toInt() == 200){ if(ret["status"].toInt() == 200){
QJsonDocument jsonDoc = QJsonDocument::fromJson(ret["text"].toString().toUtf8()); QJsonDocument jsonDoc = QJsonDocument::fromJson(ret["text"].toString().toUtf8());