fix: session issues
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { createFileRoute, Outlet, redirect } from '@tanstack/react-router';
|
||||
import { LoginLeftPanel } from '@/components/login-left-panel';
|
||||
import { LoginNavbar } from '@/components/login-navbar';
|
||||
import { SkeletonDashboard } from '@/components/skeleton-dashboard';
|
||||
import { Outlet, createFileRoute, redirect } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/_login')({
|
||||
beforeLoad: async ({ context }) => {
|
||||
if (context.session.session) {
|
||||
if (context.session?.session) {
|
||||
throw redirect({ to: '/' });
|
||||
}
|
||||
},
|
||||
@@ -14,12 +13,12 @@ export const Route = createFileRoute('/_login')({
|
||||
|
||||
function AuthLayout() {
|
||||
return (
|
||||
<div className="relative min-h-screen grid md:grid-cols-2">
|
||||
<div className="relative grid min-h-screen md:grid-cols-2">
|
||||
<LoginNavbar />
|
||||
<div className="hidden md:block">
|
||||
<LoginLeftPanel />
|
||||
</div>
|
||||
<div className="center-center w-full max-w-md mx-auto px-4">
|
||||
<div className="center-center mx-auto w-full max-w-md px-4">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user