UNPKG

@openinc/parse-server-opendash

Version:
22 lines (21 loc) 907 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.init = init; const config_1 = require("../features/config"); async function init() { Parse.Cloud.beforeLogin(async ({ object }) => { const verifyEmail = config_1.ConfigInstance.getInstance().getBoolean("AUTH_VERIFY_EMAIL"); if (verifyEmail && !object.get("emailVerified")) { throw new Parse.Error(-1, "t:AUTH_MISSING_EMAIL_VERIFICATION"); } if (object.get("tenant")) { const verifyTenant = config_1.ConfigInstance.getInstance().getBoolean("AUTH_VERIFY_TENANT"); if (verifyTenant && !object.get("tenantVerified")) { throw new Parse.Error(-1, "t:AUTH_MISSING_TENANT_VERIFICATION"); } if (object.get("tenantBanned")) { throw new Parse.Error(-1, "t:AUTH_BANNED"); } } }); }