@xuda.io/account_module 1.2.2279 → 1.2.2280
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/index.mjs +7 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -367,7 +367,13 @@ export const increment_account_usage = async function (req) {
|
|
|
367
367
|
|
|
368
368
|
if (Date.now() - doc.ts >= interval) {
|
|
369
369
|
const plan = _conf.PLAN_OBJ[account_data.membership_plan];
|
|
370
|
-
if (!plan)
|
|
370
|
+
if (!plan) {
|
|
371
|
+
// Only report missing plans for stat 3 (verified) accounts. Stat 1/2
|
|
372
|
+
// (unverified stubs, temp-pass invites, widget signups) have no plan
|
|
373
|
+
// until their first real login by design — skip silently.
|
|
374
|
+
if (account_data.stat === 3) throw new Error(`${account_data.account_info.first_name + ' ' + account_data.account_info.last_name} has no plan in file`);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
371
377
|
const drive_size_total = account_data.user_drive_size + account_data.studio_drive_size + account_data.workspace_drive_size + account_data.builds_drive_size + account_data.plugins_drive_size;
|
|
372
378
|
if (bytesToGB(drive_size_total) > plan.features.drive) {
|
|
373
379
|
var price_per_hour = (bytesToGB(drive_size_total) * _conf.PRICE_OBJ.price_per_gb_drive) / _conf.PRICE_OBJ.avg_hours_in_month;
|