* @brief Activate Pro from a signed offline certificate file, with no network access. */
| 179 | * @brief Activate Pro from a signed offline certificate file, with no network access. |
| 180 | */ |
| 181 | API::CommandResponse API::Handlers::LicensingHandler::activateOffline(const QString& id, |
| 182 | const QJsonObject& params) |
| 183 | { |
| 184 | if (!params.contains(QStringLiteral("path"))) { |
| 185 | return CommandResponse::makeError( |
| 186 | id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: path")); |
| 187 | } |
| 188 | |
| 189 | auto& offline = Licensing::OfflineLicense::instance(); |
| 190 | if (!offline.activateFromFile(params.value(QStringLiteral("path")).toString())) |
| 191 | return CommandResponse::makeError(id, ErrorCode::ExecutionError, offline.lastError()); |
| 192 | |
| 193 | return CommandResponse::makeSuccess(id, {}); |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * @brief Activate the stored license key against the LemonSqueezy server. |
nothing calls this directly
no test coverage detected