Update frontend

This commit is contained in:
g
2025-02-08 17:01:18 +00:00
parent 5d10a3aabb
commit 5755fbaa74
2 changed files with 3 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
export default function LoginPage() {
const [username, setUsername] = useState(""); // ✅ Fixed incorrect state name
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
const router = useRouter();
@@ -20,7 +20,7 @@ export default function LoginPage() {
e.preventDefault();
setError("");
const res = await fetchData("http://localhost:3001/api/auth/login", {
const res = await fetchData(`${process.env.NEXT_PUBLIC_API_URL}/auth/login`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, password }),