feat(auth): wire AuthProvider + RequireAuth into app shell

This commit is contained in:
Nora
2026-06-22 15:16:52 -06:00
parent 3d0c7766f0
commit cb87456575
5 changed files with 174 additions and 170 deletions
+10 -1
View File
@@ -13,6 +13,8 @@ import { Acks } from "@/pages/Acks";
import { Batches } from "@/pages/Batches";
import { BatchDiff } from "@/pages/BatchDiff";
import Inbox from "@/pages/Inbox";
import { Login } from "@/pages/Login";
import { RequireAuth } from "@/auth/RequireAuth";
function NotFound() {
return (
@@ -27,7 +29,14 @@ export default function App() {
return (
<DrillStackProvider>
<Routes>
<Route element={<Layout />}>
{/* /login sits OUTSIDE the auth-gated Layout so an
unauthenticated operator can reach the sign-in screen. */}
<Route path="/login" element={<Login />} />
{/* Every other route inherits the auth gate via RequireAuth
wrapping the Layout outlet. Authenticated operators see
the full app; unauthenticated ones are bounced back here
with `?next=<current>`. */}
<Route element={<RequireAuth><Layout /></RequireAuth>}>
<Route index element={<Dashboard />} />
<Route path="claims" element={<Claims />} />
<Route path="remittances" element={<Remittances />} />