mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
bugfix: fixed sending requests if there are no premium v1 keys in the application (#1599)
This commit is contained in:
@@ -29,18 +29,20 @@ bool ApiPremV1MigrationController::hasConfigsToMigration()
|
|||||||
vpnKeys.append(vpnKey);
|
vpnKeys.append(vpnKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
GatewayController gatewayController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
if (!vpnKeys.isEmpty()) {
|
||||||
m_settings->isStrictKillSwitchEnabled());
|
GatewayController gatewayController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
||||||
QJsonObject apiPayload;
|
m_settings->isStrictKillSwitchEnabled());
|
||||||
|
QJsonObject apiPayload;
|
||||||
|
|
||||||
apiPayload["configs"] = vpnKeys;
|
apiPayload["configs"] = vpnKeys;
|
||||||
QByteArray responseBody;
|
QByteArray responseBody;
|
||||||
ErrorCode errorCode = gatewayController.post(QString("%1v1/prem-v1/is-active-subscription"), apiPayload, responseBody);
|
ErrorCode errorCode = gatewayController.post(QString("%1v1/prem-v1/is-active-subscription"), apiPayload, responseBody);
|
||||||
|
|
||||||
auto migrationsStatus = QJsonDocument::fromJson(responseBody).object();
|
auto migrationsStatus = QJsonDocument::fromJson(responseBody).object();
|
||||||
for (const auto &migrationStatus : migrationsStatus) {
|
for (const auto &migrationStatus : migrationsStatus) {
|
||||||
if (migrationStatus == "not_found") {
|
if (migrationStatus == "not_found") {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user