Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88ba9915c6 | |||
| 26cdd69a49 |
+2
-3
@@ -386,10 +386,9 @@ export function App() {
|
||||
return <Navigate to="/setup" replace />;
|
||||
}
|
||||
|
||||
// Redirect staff to /admin; allow customers to access portal (preserve impersonation via ?sessionId=)
|
||||
// Redirect authenticated users to /admin (but preserve impersonation flow via ?sessionId=)
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
const isStaff = session?.user && (session.user as any).role === "staff";
|
||||
if (!authDisabled && session && !location.pathname.startsWith("/admin") && !searchParams.has("sessionId") && isStaff) {
|
||||
if (!authDisabled && session && !location.pathname.startsWith("/admin") && !searchParams.has("sessionId")) {
|
||||
return <Navigate to="/admin" replace />;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { render, screen, fireEvent, waitFor, act } from "@testing-library/react";
|
||||
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
||||
import { parseTimeTo24Hour, isUpcoming, CustomerNotesSection, ConfirmationSection } from "../portal/sections/Appointments.tsx";
|
||||
|
||||
const UPCOMING_APPT = {
|
||||
|
||||
@@ -664,6 +664,7 @@ export function RescheduleFlow({
|
||||
<h3 className="font-medium text-stone-800 mb-3">Pick a New Date & Time</h3>
|
||||
<input
|
||||
type="date"
|
||||
aria-label="Select date"
|
||||
value={selectedDate}
|
||||
onChange={(e) => setSelectedDate(e.target.value)}
|
||||
min={new Date().toISOString().split('T')[0]}
|
||||
@@ -1073,6 +1074,7 @@ function BookingFlow({ onClose, sessionId }: BookingFlowProps) {
|
||||
<h3 className="font-medium text-stone-800 mb-3">Pick Date & Time</h3>
|
||||
<input
|
||||
type="date"
|
||||
aria-label="Select date"
|
||||
value={selectedDate}
|
||||
onChange={(e) => setSelectedDate(e.target.value)}
|
||||
min={new Date().toISOString().split('T')[0]}
|
||||
|
||||
Reference in New Issue
Block a user