fix(portal): revert Dashboard redirect to show message instead
Dashboard had a defense-in-depth Navigate to /login when sessionId is null. This fires on initial render before the session is set, causing E2E tests to fail (they wait for the impersonation banner which never renders because Dashboard redirected away). Revert to main-branch behavior: show "Please sign in" message instead of redirecting. The CustomerPortal-level redirect is sufficient. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
49aa6ac989
commit
fa92a65a35
@@ -1,5 +1,4 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { Navigate } from "react-router-dom";
|
|
||||||
import { Calendar, Clock, PawPrint, CreditCard, Star, ChevronRight, AlertTriangle } from "lucide-react";
|
import { Calendar, Clock, PawPrint, CreditCard, Star, ChevronRight, AlertTriangle } from "lucide-react";
|
||||||
|
|
||||||
interface DashboardProps {
|
interface DashboardProps {
|
||||||
@@ -184,7 +183,13 @@ export function Dashboard({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sessionId) {
|
if (!sessionId) {
|
||||||
return <Navigate to="/login" replace />;
|
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>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const upcomingAppointments = getUpcomingAppointments();
|
const upcomingAppointments = getUpcomingAppointments();
|
||||||
|
|||||||
Reference in New Issue
Block a user