Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: custom domains

mxkaske 979cb242 689b3999

+8 -3
+8 -3
apps/web/src/app/status-page/[domain]/_components/actions.ts
··· 3 3 import { z } from "zod"; 4 4 5 5 import { trackAnalytics } from "@openstatus/analytics"; 6 - import { and, eq, sql } from "@openstatus/db"; 6 + import { and, eq, or, sql } from "@openstatus/db"; 7 7 import { db } from "@openstatus/db/src/db"; 8 8 import { page, pageSubscriber } from "@openstatus/db/src/schema"; 9 9 import { sendEmail, SubscribeEmail } from "@openstatus/emails"; ··· 113 113 }; 114 114 } 115 115 116 + const { slug, password } = validatedFields.data; 117 + 116 118 const _page = await db 117 119 .select() 118 120 .from(page) 119 - .where(eq(page.slug, validatedFields.data.slug)) 121 + .where( 122 + // REMINDER: customDomain for pro users 123 + sql`lower(${page.slug}) = ${slug} OR lower(${page.customDomain}) = ${slug}`, 124 + ) 120 125 .get(); 121 126 122 127 if (!_page) { ··· 125 130 }; 126 131 } 127 132 128 - if (_page.password !== validatedFields.data.password) { 133 + if (_page.password !== password) { 129 134 return { 130 135 error: "Invalid password", 131 136 };