| 75 | } |
| 76 | |
| 77 | void Yggdrasil::refresh() { |
| 78 | start(); |
| 79 | /* |
| 80 | * { |
| 81 | * "clientToken": "client identifier" |
| 82 | * "accessToken": "current access token to be refreshed" |
| 83 | * "selectedProfile": // specifying this causes errors |
| 84 | * { |
| 85 | * "id": "profile ID" |
| 86 | * "name": "profile name" |
| 87 | * } |
| 88 | * "requestUser": true/false // request the user structure |
| 89 | * } |
| 90 | */ |
| 91 | QJsonObject req; |
| 92 | req.insert("clientToken", m_data->clientToken()); |
| 93 | req.insert("accessToken", m_data->accessToken()); |
| 94 | /* |
| 95 | { |
| 96 | auto currentProfile = m_account->currentProfile(); |
| 97 | QJsonObject profile; |
| 98 | profile.insert("id", currentProfile->id()); |
| 99 | profile.insert("name", currentProfile->name()); |
| 100 | req.insert("selectedProfile", profile); |
| 101 | } |
| 102 | */ |
| 103 | req.insert("requestUser", false); |
| 104 | QJsonDocument doc(req); |
| 105 | |
| 106 | QUrl reqUrl = getBaseUrl() + "/refresh"; |
| 107 | QByteArray requestData = doc.toJson(); |
| 108 | |
| 109 | sendRequest(reqUrl, requestData); |
| 110 | } |
| 111 | |
| 112 | void Yggdrasil::login(QString password) { |
| 113 | start(); |
no test coverage detected