Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions app/(general)/event/[id]/(general)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ type Props = {
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;

// Validate ID is numeric before calling backend (prevents bot-triggered strconv.ParseUint errors)
if (!/^\d+$/.test(id)) {
notFound();
}

let event;

try {
Expand All @@ -40,11 +35,6 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
export default async function EventLayout({ params, children }: Props) {
const p = await params;

// Validate ID is numeric before calling backend
if (!/^\d+$/.test(p.id)) {
notFound();
}

let event;

try {
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions lib/queries/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export const eventOptions = (id: string) =>
queryOptions({
queryKey: ["event", id],
queryFn: async () => {
// Validate ID is numeric before calling backend
if (!/^\d+$/.test(id)) {
throw new Error("event not found");
}

return withSpan(`query:backend:event:${id}`, async () => {
const res = await zenaoClient.getEvent({ eventId: id });
if (res.event == null) {
Expand Down
22 changes: 10 additions & 12 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const nextConfig: NextConfig = {
process.env.NEXT_PUBLIC_ZENAO_BACKEND_ENDPOINT || "";
const backendCspOrigin = backendEndpoint
? (() => {
try {
return new URL(backendEndpoint).origin;
} catch {
return "";
}
})()
try {
return new URL(backendEndpoint).origin;
} catch {
return "";
}
})()
: "";

const cspDirectives = [
Expand Down Expand Up @@ -120,9 +120,9 @@ export default withSentryConfig(withNextIntl(nextConfig), {
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options

org: "sentry",
project: "zenao",

org: process.env.SENTRY_ORG_SLUG ?? "sentry",
project: process.env.SENTRY_PROJECT_SLUG ?? "zenao",
sentryUrl: process.env.SENTRY_URL,
// Only print logs for uploading source maps in CI
silent: !process.env.CI,

Expand All @@ -137,8 +137,7 @@ export default withSentryConfig(withNextIntl(nextConfig), {

sourcemaps: {
deleteSourcemapsAfterUpload: true,
disable:
(process.env.NEXT_PUBLIC_ENV ?? "development") === "development",
disable: (process.env.NEXT_PUBLIC_ENV ?? "development") === "development",
},
bundleSizeOptimizations: {
excludeReplayIframe: true,
Expand All @@ -151,4 +150,3 @@ export default withSentryConfig(withNextIntl(nextConfig), {
automaticVercelMonitors: true,
},
});

Loading