This commit is contained in:
zramsay 2025-03-12 13:51:05 -04:00
parent d9307ba127
commit af06702049
2 changed files with 48 additions and 0 deletions

View File

@ -13,6 +13,18 @@ export default function DatabaseDebugPage() {
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
const [testResult, setTestResult] = useState(null)
// Restrict access in production
const isProduction = process.env.NODE_ENV === 'production'
const [redirecting, setRedirecting] = useState(false)
useEffect(() => {
// In production, redirect to home page
if (isProduction) {
setRedirecting(true)
window.location.href = '/'
}
}, [isProduction])
useEffect(() => {
async function fetchData() {
@ -58,6 +70,18 @@ export default function DatabaseDebugPage() {
fetchData()
}, [session])
// If redirecting, show a simple loading message
if (isProduction || redirecting) {
return (
<div className="min-h-screen bg-slate-900 text-white flex items-center justify-center">
<div className="text-center">
<p>Debug mode is disabled in production.</p>
<p>Redirecting to home page...</p>
</div>
</div>
);
}
return (
<div className="min-h-screen bg-slate-900 text-white p-8">
<Navigation />

View File

@ -13,6 +13,18 @@ export default function DebugPage() {
const [jwtTest, setJwtTest] = useState<any>(null);
const [authTest, setAuthTest] = useState<any>(null);
const [authError, setAuthError] = useState<string | null>(null);
// Restrict access in production
const isProduction = process.env.NODE_ENV === 'production';
const [redirecting, setRedirecting] = useState(false);
useEffect(() => {
// In production, redirect to home page
if (isProduction) {
setRedirecting(true);
window.location.href = '/';
}
}, [isProduction]);
useEffect(() => {
const checkAuth = async () => {
@ -146,6 +158,18 @@ export default function DebugPage() {
WINDOW_LOCATION: typeof window !== 'undefined' ? window.location.hostname : null,
};
// If redirecting, show a simple loading message
if (isProduction || redirecting) {
return (
<div className="min-h-screen bg-gradient-to-b from-emerald-950 via-green-900 to-emerald-950 flex items-center justify-center">
<div className="text-white text-center">
<p>Debug mode is disabled in production.</p>
<p>Redirecting to home page...</p>
</div>
</div>
);
}
return (
<div className="min-h-screen bg-gradient-to-b from-emerald-950 via-green-900 to-emerald-950">
<div className="container max-w-7xl mx-auto px-4 py-8">