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:
@@ -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 {
|
||||||
|
|||||||
@@ -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']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user