diff --git a/VoiceInk/Services/PolarService.swift b/VoiceInk/Services/PolarService.swift index 771163f..9ac4bbd 100644 --- a/VoiceInk/Services/PolarService.swift +++ b/VoiceInk/Services/PolarService.swift @@ -93,6 +93,11 @@ class PolarService { } } + // Log successful response + let rawResponse = String(data: data, encoding: .utf8) ?? "Unable to decode response" + let statusCode = (httpResponse as? HTTPURLResponse)?.statusCode ?? 0 + logger.notice("🔑 License validation success [HTTP \(statusCode)]: \(rawResponse, privacy: .public)") + let validationResponse = try JSONDecoder().decode(LicenseValidationResponse.self, from: data) let isValid = validationResponse.status == "granted" @@ -139,6 +144,11 @@ class PolarService { } } + // Log successful response + let rawResponse = String(data: data, encoding: .utf8) ?? "Unable to decode response" + let statusCode = (httpResponse as? HTTPURLResponse)?.statusCode ?? 0 + logger.notice("🔑 License activation success [HTTP \(statusCode)]: \(rawResponse, privacy: .public)") + let activationResult = try JSONDecoder().decode(ActivationResult.self, from: data) return (activationId: activationResult.id, activationsLimit: activationResult.license_key.limit_activations) @@ -169,6 +179,11 @@ class PolarService { } } + // Log successful response + let rawResponse = String(data: data, encoding: .utf8) ?? "Unable to decode response" + let statusCode = (httpResponse as? HTTPURLResponse)?.statusCode ?? 0 + logger.notice("🔑 License validation with activation success [HTTP \(statusCode)]: \(rawResponse, privacy: .public)") + let validationResponse = try JSONDecoder().decode(LicenseValidationResponse.self, from: data) return validationResponse.status == "granted"