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"; import { Label } from "@/components/ui/label";
export default function LoginPage() { export default function LoginPage() {
const [username, setUsername] = useState(""); // ✅ Fixed incorrect state name const [username, setUsername] = useState("");
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [error, setError] = useState(""); const [error, setError] = useState("");
const router = useRouter(); const router = useRouter();
@@ -20,7 +20,7 @@ export default function LoginPage() {
e.preventDefault(); e.preventDefault();
setError(""); 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", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, password }), body: JSON.stringify({ username, password }),

View File

@@ -22,7 +22,7 @@ export default function RegisterPage() {
setLoading(true); setLoading(true);
const res = await fetchData( const res = await fetchData(
"https://internal-api.inboxi.ng/api/auth/register", `${process.env.NEXT_PUBLIC_API_URL}/auth/register`,
{ {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },