mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
Merge pull request #974 from LikiosSedo/fix/remove-authtype-useeffect
fix: remove unnecessary useEffect + useState for AUTH_TYPE constant
This commit is contained in:
commit
a913e616e6
1 changed files with 2 additions and 7 deletions
|
|
@ -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";
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue