mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
feat: compare store ID
This commit is contained in:
parent
4012f8d0fb
commit
d5d78afa76
3 changed files with 11 additions and 0 deletions
|
@ -28,6 +28,7 @@ class AlbumRepository extends Repository
|
|||
/** @return Collection|array<array-key, Album> */
|
||||
public function getMostPlayed(int $count = 6, ?User $user = null): Collection
|
||||
{
|
||||
/** @var ?User $user */
|
||||
$user ??= $this->auth->user();
|
||||
|
||||
$query = Album::query()
|
||||
|
|
|
@ -28,6 +28,10 @@ class LicenseService
|
|||
'instance_name' => 'Koel Plus',
|
||||
]);
|
||||
|
||||
if ($response->meta->store_id !== config('lemonsqueezy.store_id')) {
|
||||
throw new FailedToActivateLicenseException('This license key is not from Koel’s official store.');
|
||||
}
|
||||
|
||||
return $this->updateOrCreateLicenseFromApiResponse($response);
|
||||
} catch (ClientException $e) {
|
||||
throw new FailedToActivateLicenseException(json_decode($e->getResponse()->getBody())->error, $e->getCode());
|
||||
|
|
6
config/lemonsqueezy.php
Normal file
6
config/lemonsqueezy.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'store_id' => 62685,
|
||||
'store_url' => 'https://store.plus.koel.dev',
|
||||
];
|
Loading…
Reference in a new issue