fix: add connection to backend (#34)
Release package / release (push) Has been cancelled

Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com>
Reviewed-on: #34
This commit was merged in pull request #34.
This commit is contained in:
2026-04-19 02:22:46 +00:00
parent 77f9a11132
commit 96584c5494
5 changed files with 29 additions and 51 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ import LoginInput from "@/components/atoms/inputs/LoginInput";
import { useAuth } from "@/lib/auth-context";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { FormEvent, useState } from "react";
import { SubmitEvent, useState } from "react";
export default function LoginForm() {
const router = useRouter();
@@ -39,12 +39,12 @@ export default function LoginForm() {
return isValid;
};
const handleSubmit = (e: FormEvent) => {
const handleSubmit = async (e: SubmitEvent<HTMLFormElement>) => {
e.preventDefault();
if (!validate()) return;
const success = login(username, password);
const success = await login(username, password);
if (success) {
router.push("/");