diff --git a/next.config.ts b/next.config.ts index c51e6b1f..847028f2 100644 --- a/next.config.ts +++ b/next.config.ts @@ -50,6 +50,10 @@ const nextConfig: NextConfig = { cleanDistDir: true, env: { NEXT_PUBLIC_PAGESPEED_API_KEY: process.env.NEXT_PUBLIC_PAGESPEED_API_KEY, + // Deploy workflows omit NEXT_PUBLIC_BASE_PATH and rely on detect-project.js, + // so the resolved basePath must be injected here or client code that builds + // URLs (auth redirects) sees '' in production (issue #154). + NEXT_PUBLIC_BASE_PATH: basePath, }, webpack: (config, { isServer }) => { // Optimize code splitting for better performance diff --git a/src/app/reset-password/page.tsx b/src/app/reset-password/page.tsx index f42b0feb..966991db 100644 --- a/src/app/reset-password/page.tsx +++ b/src/app/reset-password/page.tsx @@ -2,6 +2,7 @@ import React from 'react'; import ResetPasswordForm from '@/components/auth/ResetPasswordForm'; +import { getInternalUrl } from '@/config/project.config'; export default function ResetPasswordPage() { return ( @@ -12,7 +13,7 @@ export default function ResetPasswordPage() { (window.location.href = '/sign-in')} + onSuccess={() => (window.location.href = getInternalUrl('/sign-in'))} /> diff --git a/src/app/sign-up/page.tsx b/src/app/sign-up/page.tsx index 86b9b593..fc996499 100644 --- a/src/app/sign-up/page.tsx +++ b/src/app/sign-up/page.tsx @@ -4,6 +4,7 @@ import React, { useState, useEffect } from 'react'; import SignUpForm from '@/components/auth/SignUpForm'; import OAuthButtons from '@/components/auth/OAuthButtons'; import Link from 'next/link'; +import { getInternalUrl } from '@/config/project.config'; function isSafeRedirectUrl(url: string): boolean { if (!url || !url.startsWith('/')) return false; @@ -36,7 +37,9 @@ export default function SignUpPage() { (window.location.href = '/verify-email')} + onSuccess={() => + (window.location.href = getInternalUrl('/verify-email')) + } />
OR
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 1db097e1..ce685f3e 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -6,6 +6,7 @@ import errorHandler, { ErrorSeverity, ErrorCategory, } from '@/utils/error-handler'; +import { getInternalUrl } from '@/config/project.config'; interface Props { children: ReactNode; @@ -280,7 +281,7 @@ class ErrorBoundary extends Component { {level === 'page' && (