fix(portal): redirect unauthenticated users to /login

CustomerPortal now redirects to /login after session init completes
with no valid session, preventing portal chrome from rendering for
unauthenticated users. Dashboard !sessionId branch uses Navigate
redirect instead of dead-end UI. Staff redirect in App.tsx verified.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Barkley Trimsworth
2026-03-30 19:12:38 +00:00
parent 01cb8d87a0
commit b0ab41bb4e
3 changed files with 34 additions and 11 deletions
+2 -7
View File
@@ -1,4 +1,5 @@
import { useState, useEffect } from "react";
import { Navigate } from "react-router-dom";
import { Calendar, Clock, PawPrint, CreditCard, Star, ChevronRight, AlertTriangle } from "lucide-react";
interface DashboardProps {
@@ -183,13 +184,7 @@ export function Dashboard({
}
if (!sessionId) {
return (
<div className="space-y-6">
<div className="bg-stone-100 rounded-2xl p-5 text-center">
<p className="text-stone-600">Please sign in to view your dashboard.</p>
</div>
</div>
);
return <Navigate to="/login" replace />;
}
const upcomingAppointments = getUpcomingAppointments();