Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions surfsense_web/app/(home)/login/LocalLoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AnimatePresence, motion } from "motion/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { useEffect, useState } from "react";
import { useState } from "react";
import { loginMutationAtom } from "@/atoms/auth/auth-mutation.atoms";
import { Spinner } from "@/components/ui/spinner";
import { getAuthErrorDetails, isNetworkError } from "@/lib/auth-errors";
Expand All @@ -25,15 +25,10 @@ export function LocalLoginForm() {
title: null,
message: null,
});
const [authType, setAuthType] = useState<string | null>(null);
const authType = AUTH_TYPE;
const router = useRouter();
const [{ mutateAsync: login, isPending: isLoggingIn }] = useAtom(loginMutationAtom);

useEffect(() => {
// Get the auth type from centralized config
setAuthType(AUTH_TYPE);
}, []);

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError({ title: null, message: null }); // Clear any previous errors
Expand Down