mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 05:51:39 +00:00
feat: initial auth config
This commit is contained in:
19
src/routes/_authenticated.tsx
Normal file
19
src/routes/_authenticated.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createFileRoute, Navigate, Outlet } from "@tanstack/react-router"
|
||||
import { Authenticated, Unauthenticated } from "convex/react"
|
||||
|
||||
export const Route = createFileRoute("/_authenticated")({
|
||||
component: AuthenticatedLayout,
|
||||
})
|
||||
|
||||
function AuthenticatedLayout() {
|
||||
return (
|
||||
<>
|
||||
<Authenticated>
|
||||
<Outlet />
|
||||
</Authenticated>
|
||||
<Unauthenticated>
|
||||
<Navigate to="/login" />
|
||||
</Unauthenticated>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user