feat(auth): wire AuthProvider + RequireAuth into app shell
This commit is contained in:
+10
-1
@@ -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 />} />
|
||||
|
||||
Reference in New Issue
Block a user