Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { useEffect, useRef } from 'react';
|
|
|
|
|
import { useRouter, useSearchParams } from 'next/navigation';
|
|
|
|
|
import { Loader2 } from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
export default function PortalVerifyPage() {
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const searchParams = useSearchParams();
|
|
|
|
|
const calledRef = useRef(false);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (calledRef.current) return;
|
|
|
|
|
calledRef.current = true;
|
|
|
|
|
|
|
|
|
|
const token = searchParams.get('token');
|
|
|
|
|
|
|
|
|
|
if (!token) {
|
2026-03-26 12:06:18 +01:00
|
|
|
router.replace('/portal/login?error=missing_token');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Redirect to the verify API route which will set the cookie and redirect
|
|
|
|
|
window.location.href = `/api/portal/auth/verify?token=${encodeURIComponent(token)}`;
|
|
|
|
|
}, [searchParams, router]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="min-h-screen flex items-center justify-center bg-gray-50">
|
|
|
|
|
<div className="text-center">
|
|
|
|
|
<Loader2 className="h-8 w-8 animate-spin text-[#1e2844] mx-auto mb-3" />
|
|
|
|
|
<p className="text-sm text-gray-500">Verifying your access...</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|