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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user