From 36127ed97c068e11b5aed756ba50b2945c70d307 Mon Sep 17 00:00:00 2001 From: Tanya Date: Wed, 7 Jan 2026 13:13:16 -0500 Subject: [PATCH] chore: Update CI workflow and enhance dynamic rendering for authentication routes This commit adds environment variables for Resend API integration in the CI workflow, ensuring proper configuration for build processes. Additionally, it enforces dynamic rendering in the authentication routes to prevent Resend initialization during build, improving the application's performance and reliability. These changes contribute to a more robust development environment and enhance the overall user experience. --- .gitea/workflows/ci.yml | 2 ++ viewer-frontend/app/api/auth/forgot-password/route.ts | 3 +++ viewer-frontend/app/api/auth/register/route.ts | 3 +++ viewer-frontend/app/api/auth/resend-confirmation/route.ts | 3 +++ 4 files changed, 11 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 32586ed..3de6ba3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -250,6 +250,8 @@ jobs: DATABASE_URL_AUTH: postgresql://postgres:postgres@localhost:5432/punimtag_auth NEXTAUTH_SECRET: test-secret-key-for-ci NEXTAUTH_URL: http://localhost:3001 + RESEND_API_KEY: re_dummy_key_for_ci_build_only + RESEND_FROM_EMAIL: test@example.com secret-scanning: needs: skip-ci-check diff --git a/viewer-frontend/app/api/auth/forgot-password/route.ts b/viewer-frontend/app/api/auth/forgot-password/route.ts index bb8d0f3..0fdaaa2 100644 --- a/viewer-frontend/app/api/auth/forgot-password/route.ts +++ b/viewer-frontend/app/api/auth/forgot-password/route.ts @@ -3,6 +3,9 @@ import { prismaAuth } from '@/lib/db'; import { generatePasswordResetToken, sendPasswordResetEmail } from '@/lib/email'; import { isValidEmail } from '@/lib/utils'; +// Force dynamic rendering to prevent Resend initialization during build +export const dynamic = 'force-dynamic'; + export async function POST(request: NextRequest) { try { const body = await request.json(); diff --git a/viewer-frontend/app/api/auth/register/route.ts b/viewer-frontend/app/api/auth/register/route.ts index eec521c..958636c 100644 --- a/viewer-frontend/app/api/auth/register/route.ts +++ b/viewer-frontend/app/api/auth/register/route.ts @@ -4,6 +4,9 @@ import bcrypt from 'bcryptjs'; import { generateEmailConfirmationToken, sendEmailConfirmation } from '@/lib/email'; import { isValidEmail } from '@/lib/utils'; +// Force dynamic rendering to prevent Resend initialization during build +export const dynamic = 'force-dynamic'; + export async function POST(request: NextRequest) { try { const body = await request.json(); diff --git a/viewer-frontend/app/api/auth/resend-confirmation/route.ts b/viewer-frontend/app/api/auth/resend-confirmation/route.ts index 19cc682..b2b984f 100644 --- a/viewer-frontend/app/api/auth/resend-confirmation/route.ts +++ b/viewer-frontend/app/api/auth/resend-confirmation/route.ts @@ -2,6 +2,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { prismaAuth } from '@/lib/db'; import { generateEmailConfirmationToken, sendEmailConfirmationResend } from '@/lib/email'; +// Force dynamic rendering to prevent Resend initialization during build +export const dynamic = 'force-dynamic'; + export async function POST(request: NextRequest) { try { const body = await request.json();