@abdarrahmanabdelnasir/relay-node 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configCache.js +4 -0
- package/dist-cjs/configCache.js +4 -0
- package/package.json +1 -1
package/dist/configCache.js
CHANGED
|
@@ -141,6 +141,10 @@ export class ConfigCache {
|
|
|
141
141
|
const premiumIds = (this.config.premiumUserIds || []).map(String);
|
|
142
142
|
const isPremiumUser = premiumIds.includes(String(userId));
|
|
143
143
|
const isPremium = isPremiumRole || isPremiumUser;
|
|
144
|
+
// Diagnostic: masked format hint to spot ID type mismatch (e.g. Discord snowflake vs Supabase user_xxx)
|
|
145
|
+
const uidSuffix = String(userId).slice(-4);
|
|
146
|
+
const firstPremiumSuffix = premiumIds[0] ? String(premiumIds[0]).slice(-4) : 'none';
|
|
147
|
+
console.log(`[commandless] premium_only check: premiumUserIds.length=${premiumIds.length}, isPremiumUser=${isPremiumUser}, allowed=${isPremium} (authorId ends ...${uidSuffix}, first premiumId ends ...${firstPremiumSuffix})`);
|
|
144
148
|
if (!isPremium) {
|
|
145
149
|
return { allowed: false, reason: 'Premium only' };
|
|
146
150
|
}
|
package/dist-cjs/configCache.js
CHANGED
|
@@ -144,6 +144,10 @@ class ConfigCache {
|
|
|
144
144
|
const premiumIds = (this.config.premiumUserIds || []).map(String);
|
|
145
145
|
const isPremiumUser = premiumIds.includes(String(userId));
|
|
146
146
|
const isPremium = isPremiumRole || isPremiumUser;
|
|
147
|
+
// Diagnostic: masked format hint to spot ID type mismatch (e.g. Discord snowflake vs Supabase user_xxx)
|
|
148
|
+
const uidSuffix = String(userId).slice(-4);
|
|
149
|
+
const firstPremiumSuffix = premiumIds[0] ? String(premiumIds[0]).slice(-4) : 'none';
|
|
150
|
+
console.log(`[commandless] premium_only check: premiumUserIds.length=${premiumIds.length}, isPremiumUser=${isPremiumUser}, allowed=${isPremium} (authorId ends ...${uidSuffix}, first premiumId ends ...${firstPremiumSuffix})`);
|
|
147
151
|
if (!isPremium) {
|
|
148
152
|
return { allowed: false, reason: 'Premium only' };
|
|
149
153
|
}
|