Skip to content

Commit 706d14e

Browse files
committed
bugfix: cannot get license tier while verify via offlicen license
1 parent f786100 commit 706d14e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Licensing/LicenseManager.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ public function verify()
5252

5353
$failedReason = null;
5454

55+
// Then, Try to verify the license online
5556
try {
5657

57-
// Try to verify the license online first
58-
5958
$payload = $this->payload();
6059
$response = Http::timeout(self::REQUEST_TIMEOUT)->post($this->fetchActionPath('validate'), $payload);
6160

@@ -217,7 +216,14 @@ protected function verifyOffline()
217216

218217
$licenseData = json_decode(File::get($this->licenseKeyPath()), true);
219218

220-
return $this->dataVerification($licenseData) ?? LicenseVerificationResult::successOffline(data: $licenseData);
219+
if ($dataValidationFailure = $this->dataVerification($licenseData)) {
220+
return $dataValidationFailure;
221+
}
222+
223+
return LicenseVerificationResult::successOffline(data: [
224+
'success' => true,
225+
'license' => $licenseData,
226+
]);
221227

222228
} catch (\Throwable $th) {
223229

0 commit comments

Comments
 (0)