- added settings page and function
- add Role Ring for avatar and display role for user nav
This commit is contained in:
@@ -1,18 +1,14 @@
|
||||
import { authMiddleware } from '@/lib/middleware'
|
||||
import { createFileRoute, Outlet, redirect } from '@tanstack/react-router'
|
||||
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' })
|
||||
throw redirect({ to: '/sign-in' });
|
||||
}
|
||||
},
|
||||
component: RouteComponent,
|
||||
server: {
|
||||
middleware: [authMiddleware],
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <Outlet />
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user