Update frontend
This commit is contained in:
@@ -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 }),
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function RegisterPage() {
|
||||
setLoading(true);
|
||||
|
||||
const res = await fetchData(
|
||||
"https://internal-api.inboxi.ng/api/auth/register",
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/auth/register`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
||||
Reference in New Issue
Block a user