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 <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 22:17:44 +03:30
co-authored by Cursor
parent 38337c62d7
commit bcf4724ac4
2 changed files with 1 additions and 18 deletions
+1 -5
View File
@@ -160,11 +160,7 @@ export class RemoteSmsAuthGuard implements CanActivate {
}, },
}); });
const hit = findTenantForHost( const hit = findTenantForHost(tenants as TenantHostRow[], normalizedHost);
tenants as TenantHostRow[],
normalizedHost,
'hmac',
);
if (!hit) return null; if (!hit) return null;
return { return {
-13
View File
@@ -809,19 +809,6 @@ export class PluginStoreService implements OnModuleInit, OnModuleDestroy {
throw new ForbiddenException('فروشگاه افزونه فقط برای خانگی است'); throw new ForbiddenException('فروشگاه افزونه فقط برای خانگی است');
} }
if (!tenantId) 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']) { private assertPrices(prices: SaveCatalogItemDto['prices']) {