added Profile Page and Change password (also included breadcrumb
This commit is contained in:
18
src/routes/(app)/(auth)/route.tsx
Normal file
18
src/routes/(app)/(auth)/route.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { authMiddleware } from '@/lib/middleware'
|
||||
import { createFileRoute, Outlet, redirect } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/(auth)')({
|
||||
beforeLoad: async ({ context }) => {
|
||||
if (!context.userSession) {
|
||||
throw redirect({ to: '/sign-in' })
|
||||
}
|
||||
},
|
||||
component: RouteComponent,
|
||||
server: {
|
||||
middleware: [authMiddleware],
|
||||
},
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return <Outlet />
|
||||
}
|
||||
Reference in New Issue
Block a user