fix render

This commit is contained in:
Michael Freno
2025-12-21 13:22:11 -05:00
parent 9970c69872
commit c0c1c48016
2 changed files with 30 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import { createSignal, createEffect, Show, onMount } from "solid-js";
import { createSignal, Show, onMount } from "solid-js";
import { Title, Meta } from "@solidjs/meta";
import { useNavigate, cache, redirect } from "@solidjs/router";
import { useNavigate, redirect, query } from "@solidjs/router";
import { getEvent } from "vinxi/http";
import Eye from "~/components/icons/Eye";
import EyeSlash from "~/components/icons/EyeSlash";
@@ -23,7 +23,7 @@ type UserProfile = {
hasPassword: boolean;
};
const checkAuth = cache(async () => {
const checkAuth = query(async () => {
"use server";
const { checkAuthStatus } = await import("~/server/utils");
const event = getEvent()!;

View File

@@ -3,8 +3,8 @@ import {
A,
useNavigate,
useSearchParams,
cache,
redirect
redirect,
query
} from "@solidjs/router";
import { Title, Meta } from "@solidjs/meta";
import { getEvent } from "vinxi/http";
@@ -17,7 +17,7 @@ import { isValidEmail, validatePassword } from "~/lib/validation";
import { getClientCookie } from "~/lib/cookies.client";
import { env } from "~/env/client";
const checkAuth = cache(async () => {
const checkAuth = query(async () => {
"use server";
const { checkAuthStatus } = await import("~/server/utils");
const event = getEvent()!;
@@ -333,14 +333,19 @@ export default function LoginPage() {
/>
<div class="flex h-dvh flex-row justify-evenly">
{/* Main content */}
<div class="pt-12 md:pt-24">
<div class="relative pt-12 md:pt-24">
{/* Error message */}
<div class="absolute -mt-12 text-center text-red-400 italic">
<Show when={error()}>
<div class="mb-4 w-full max-w-md rounded-lg border border-red-500 bg-red-500/10 px-4 py-3 text-center">
<Show when={error() === "passwordMismatch"}>
<div class="text-3xl">Passwords did not match!</div>
<div class="text-lg font-semibold text-red-500">
Passwords did not match!
</div>
</Show>
<Show when={error() === "duplicate"}>
<div class="text-3xl">Email Already Exists!</div>
<div class="text-lg font-semibold text-red-500">
Email Already Exists!
</div>
</Show>
<Show
when={
@@ -349,9 +354,10 @@ export default function LoginPage() {
error() !== "duplicate"
}
>
<div class="max-w-md px-4 text-base">{error()}</div>
<div class="text-sm text-red-500">{error()}</div>
</Show>
</div>
</Show>
{/* Title */}
<div class="py-2 pl-6 text-2xl md:pl-0">