| 49 | } |
| 50 | |
| 51 | bool HttpReqLogin(AuthProfile* profile) |
| 52 | { |
| 53 | QJsonObject dataJson; |
| 54 | dataJson["username"] = profile->GetUsername(); |
| 55 | dataJson["password"] = profile->GetPassword(); |
| 56 | dataJson["version"] = SMALL_VERSION; |
| 57 | QByteArray jsonData = QJsonDocument(dataJson).toJson(); |
| 58 | |
| 59 | QString sUrl = profile->GetURL() + "/login"; |
| 60 | QJsonObject jsonObject = HttpReq(sUrl, jsonData, QString()); |
| 61 | if (jsonObject.contains("access_token") && jsonObject.contains("refresh_token")) { |
| 62 | profile->SetAccessToken( jsonObject["access_token"].toString() ); |
| 63 | profile->SetRefreshToken( jsonObject["refresh_token"].toString() ); |
| 64 | return true; |
| 65 | } |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | bool HttpReqJwtUpdate(AuthProfile* profile) |
| 70 | { |
no test coverage detected