From bcf4724ac4e94f71cacd91eb81b509b749f7f055 Mon Sep 17 00:00:00 2001 From: adonis Date: Wed, 9 Sep 2026 22:17:44 +0330 Subject: [PATCH] fix plugin store remote: find tenant by admin URL and allow purchase HMAC k.montzar.ir matches the version that uses that admin panel. Remote buy is no longer blocked by plugin_store_enabled. Co-authored-by: Cursor --- src/auth/remote-sms-auth.guard.ts | 6 +----- src/plugins/plugin-store.service.ts | 13 ------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/auth/remote-sms-auth.guard.ts b/src/auth/remote-sms-auth.guard.ts index fd065b1..30e7683 100644 --- a/src/auth/remote-sms-auth.guard.ts +++ b/src/auth/remote-sms-auth.guard.ts @@ -160,11 +160,7 @@ export class RemoteSmsAuthGuard implements CanActivate { }, }); - const hit = findTenantForHost( - tenants as TenantHostRow[], - normalizedHost, - 'hmac', - ); + const hit = findTenantForHost(tenants as TenantHostRow[], normalizedHost); if (!hit) return null; return { diff --git a/src/plugins/plugin-store.service.ts b/src/plugins/plugin-store.service.ts index 22d5765..eee63dd 100644 --- a/src/plugins/plugin-store.service.ts +++ b/src/plugins/plugin-store.service.ts @@ -809,19 +809,6 @@ export class PluginStoreService implements OnModuleInit, OnModuleDestroy { throw new ForbiddenException('فروشگاه افزونه فقط برای خانگی است'); } if (!tenantId) throw new ForbiddenException('نسخه نامعتبر است'); - if (!(await this.isStoreEnabled(tenantId))) { - const tenant = await this.prisma.tenant.findUnique({ - where: { id: tenantId }, - select: { nameFa: true, domain: true }, - }); - const who = tenant - ? `${tenant.nameFa} (${tenant.domain})` - : tenantId; - this.logger.warn(`plugin store off for ${who}`); - throw new ForbiddenException( - `فروشگاه افزونه برای این نسخه خاموش است: ${who}`, - ); - } } private assertPrices(prices: SaveCatalogItemDto['prices']) {