fix: session issues

This commit is contained in:
Carl-Gerhard Lindesvärd
2026-02-25 12:42:43 +01:00
parent a4cb410d3e
commit 6dca57d7ce
8 changed files with 124 additions and 126 deletions

View File

@@ -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>