import type {MetaFunction} from "@remix-run/node" import {Link, useLocation} from "@remix-run/react" import {z} from "zod" import {Button} from "~/components/ui/button" import logoPng from "~/images/lume-logo.png?url" import lumeColorLogoPng from "~/images/lume-color-logo.png?url" import discordLogoPng from "~/images/discord-logo.png?url" import lumeBgPng from "~/images/lume-bg-image.png?url" import {Field, FieldCheckbox} from "~/components/forms" import {getFormProps, useForm} from "@conform-to/react" import {getZodConstraint, parseWithZod} from "@conform-to/zod" import {useGo, useIsAuthenticated, useLogin} from "@refinedev/core"; import {AuthFormRequest} from "~/data/auth-provider.js"; import {useEffect} from "react"; export const meta: MetaFunction = () => { return [ {title: "Login"}, {name: "description", content: "Welcome to Lume!"} ] } export default function Login() { const location = useLocation() const {isLoading: isAuthLoading, data: authData} = useIsAuthenticated(); const auth = useIsAuthenticated(); const hash = location.hash const go = useGo(); useEffect(() => { if (!isAuthLoading) { if (authData?.authenticated) { go({to: "/dashboard", type: "replace"}); } } }, [isAuthLoading, authData]); return (