diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx index 29fdaee..8ed3262 100644 --- a/src/Components/API/API.tsx +++ b/src/Components/API/API.tsx @@ -63,9 +63,9 @@ export function ParseError(error: { response: { data: string } }) { } // User APIs -export function RegisterAPI(register: RegisterType) { +export function RegisterAPI(info: RegisterType) { return instance - .post("api/v1/accounts/users/", register) + .post("api/v1/accounts/users/", info) .then(async (response) => { console.log(response.data); return [true, 0]; @@ -86,11 +86,11 @@ export function LoginAPI(user: LoginType, remember_session: boolean) { setRefreshToken(response.data.refresh); } - console.log("Login Success "); + console.log("Login Success"); return true; }) - .catch(() => { - console.log("Login Failed"); + .catch((error) => { + console.log("Login Failed", error.response.data); return false; }); } diff --git a/src/Pages/ActivationPage/ActivationPage.tsx b/src/Pages/ActivationPage/ActivationPage.tsx index e95cf28..11e4f0a 100644 --- a/src/Pages/ActivationPage/ActivationPage.tsx +++ b/src/Pages/ActivationPage/ActivationPage.tsx @@ -38,7 +38,7 @@ export default function ActivationPage() { theme: "light", }); setTimeout(() => { - navigate("/dashboard"); + navigate("/"); }); } else { setFeedback("Invalid activation link"); diff --git a/src/Pages/ResetPasswordPage/ResetPasswordPage.tsx b/src/Pages/ResetPasswordPage/ResetPasswordPage.tsx index c70bdde..5ca2a75 100644 --- a/src/Pages/ResetPasswordPage/ResetPasswordPage.tsx +++ b/src/Pages/ResetPasswordPage/ResetPasswordPage.tsx @@ -80,9 +80,9 @@ export default function ResetPasswordPage() { label="Confirm Password" placeholder={"Re-enter password"} onChange={(e: React.ChangeEvent) => - setUser({ ...user, password: e.target.value }) + setUser({ ...user, confirm_password: e.target.value }) } - value={user.password} + value={user.confirm_password} />
{" "} + />

{feedback}