fix(ui): apply CodeRabbit feedback on cloud env migration

- Evaluate isCloud() during sign-up validation instead of at module load, avoiding an island/bundle race; use Zod 4 error syntax
- Scope Dockerfile env docs to the real integration legacy names, dropping the misleading NEXT_PUBLIC_* wildcard
This commit is contained in:
Pablo F.G
2026-07-21 11:49:17 +02:00
parent 44294d9850
commit b0b44f40a3
2 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -81,8 +81,8 @@ ENV HOSTNAME="0.0.0.0"
# - optional: UI_API_DOCS_URL
# - optional: UI_CLOUD_ENABLED ("true" only in Prowler Cloud deployments)
# - gated integrations (load only when *_ENABLED="true"; the value is then
# required or boot fails). Legacy names (NEXT_PUBLIC_*, POSTHOG_KEY/HOST)
# still activate without the flag:
# required or boot fails). Their legacy names (NEXT_PUBLIC_SENTRY_*,
# NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID, POSTHOG_KEY/HOST) still work:
# UI_SENTRY_ENABLED + UI_SENTRY_DSN (+ optional UI_SENTRY_ENVIRONMENT)
# UI_GOOGLE_TAG_MANAGER_ENABLED + UI_GOOGLE_TAG_MANAGER_ID
# UI_POSTHOG_ENABLED + UI_POSTHOG_KEY + UI_POSTHOG_HOST (no consumer yet)
+6 -5
View File
@@ -105,11 +105,12 @@ export const signUpSchema = baseAuthSchema
}),
company: z.string().optional(),
invitationToken: z.string().optional(),
termsAndConditions: isCloud()
? z.boolean().refine((value) => value === true, {
message: "You must accept the terms and conditions.",
})
: z.boolean().optional(),
termsAndConditions: z
.boolean()
.optional()
.refine((value) => !isCloud() || value === true, {
error: "You must accept the terms and conditions.",
}),
})
.refine(
(data) => {