Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Improve redirect error message (#4831)

Oleg Isonen09a1ecdd848a
diff --git a/packages/sdk/src/schema/pages.ts b/packages/sdk/src/schema/pages.ts
index 6b93330d97..c221d5ef3d 100644
--- a/packages/sdk/src/schema/pages.ts
+++ b/packages/sdk/src/schema/pages.ts
@@ -92,7 +92,10 @@ export const PagePath = z
.string()
.refine((path) => path !== "", "Can't be empty")
.refine((path) => path !== "/", "Can't be just a /")
- .refine((path) => path === "" || path.startsWith("/"), "Must start with a /")
+ .refine(
+ (path) => path === "" || path.startsWith("/"),
+ "Must start with a / or a full URL e.g. https://website.org"
+ )
.refine((path) => path.endsWith("/") === false, "Can't end with a /")
.refine((path) => path.includes("//") === false, "Can't contain repeating /")
.refine(