Adding production grade
This commit is contained in:
@@ -20,6 +20,9 @@ const CONFIG = {
|
||||
// The admin email that should receive the execution reports
|
||||
ADMIN_EMAIL: "moritz@haumdaucher.de",
|
||||
|
||||
// The primary Workspace domain for validation and auto-appending
|
||||
WORKSPACE_DOMAIN: "haumdaucher.de",
|
||||
|
||||
// Dry run mode. If true, the script will only log what it would do and send the email,
|
||||
// but will NOT actually create, update, or delete any groups in Workspace.
|
||||
DRY_RUN: true,
|
||||
@@ -145,12 +148,12 @@ function readDesiredStateFromSheet() {
|
||||
|
||||
// 1. Auto-append domain to source if they just typed a name (e.g. "frederic")
|
||||
if (source && !source.includes("@")) {
|
||||
source += "@haumdaucher.de";
|
||||
source += `@${CONFIG.WORKSPACE_DOMAIN}`;
|
||||
}
|
||||
|
||||
// 2. Validate source domain
|
||||
if (source && !source.endsWith("@haumdaucher.de")) {
|
||||
console.warn(`Row ${i + 1}: Skipped. Source address must belong to @haumdaucher.de domain. Found: '${source}'`);
|
||||
if (source && !source.endsWith(`@${CONFIG.WORKSPACE_DOMAIN}`)) {
|
||||
console.warn(`Row ${i + 1}: Skipped. Source address must belong to @${CONFIG.WORKSPACE_DOMAIN} domain. Found: '${source}'`);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user