2025-12-23 10:57:55 +07:00
|
|
|
import { createFileRoute, redirect } from '@tanstack/react-router'
|
|
|
|
|
import { LoginForm } from '@/components/forms/login-form'
|
2025-08-11 23:21:36 +07:00
|
|
|
|
2025-12-22 14:53:19 +07:00
|
|
|
export const Route = createFileRoute('/(auth)/login/')({
|
2025-08-11 23:21:36 +07:00
|
|
|
beforeLoad: async ({ context }) => {
|
2025-12-22 14:53:19 +07:00
|
|
|
const { token } = context.auth
|
|
|
|
|
if (token) throw redirect({ to: '/' })
|
2025-08-11 23:21:36 +07:00
|
|
|
},
|
2025-12-23 10:57:55 +07:00
|
|
|
component: LoginPage,
|
2025-08-11 23:21:36 +07:00
|
|
|
})
|
|
|
|
|
|
2025-12-23 10:57:55 +07:00
|
|
|
function LoginPage() {
|
2025-08-11 23:21:36 +07:00
|
|
|
return (
|
2025-12-23 10:57:55 +07:00
|
|
|
<div className="flex items-center justify-center min-h-screen bg-gradient-to-br from-background to-muted/20">
|
|
|
|
|
<LoginForm className="w-full max-w-md" />
|
|
|
|
|
</div>
|
2025-08-11 23:21:36 +07:00
|
|
|
)
|
|
|
|
|
}
|