mirror of
https://github.com/lemeow125/EquipmentTracker-Frontend.git
synced 2024-11-17 06:09:25 +08:00
Fixed activation page not redirecting properly on success and password reset fields not setting proper values
This commit is contained in:
parent
150663587c
commit
45c9fd588a
3 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ export default function ActivationPage() {
|
|||
theme: "light",
|
||||
});
|
||||
setTimeout(() => {
|
||||
navigate("/dashboard");
|
||||
navigate("/");
|
||||
});
|
||||
} else {
|
||||
setFeedback("Invalid activation link");
|
||||
|
|
|
@ -80,9 +80,9 @@ export default function ResetPasswordPage() {
|
|||
label="Confirm Password"
|
||||
placeholder={"Re-enter password"}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setUser({ ...user, password: e.target.value })
|
||||
setUser({ ...user, confirm_password: e.target.value })
|
||||
}
|
||||
value={user.password}
|
||||
value={user.confirm_password}
|
||||
/>
|
||||
<div style={{ justifyContent: "center", display: "flex" }}>
|
||||
<div
|
||||
|
@ -93,7 +93,7 @@ export default function ResetPasswordPage() {
|
|||
height: "4px",
|
||||
marginBottom: 8,
|
||||
}}
|
||||
/>{" "}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p style={{ ...styles.text_dark, ...styles.text_M }}>{feedback}</p>
|
||||
|
|
Loading…
Reference in a new issue