UPDATE: Updated VideoPage UI

UPDATE: Added response to successful password reset redirect to homepage
This commit is contained in:
JustIceO7
2025-02-14 00:14:16 +00:00
parent 9bd1e249ed
commit 88c9b168fd
9 changed files with 98 additions and 78 deletions

View File

@@ -27,10 +27,6 @@ const PasswordResetForm: React.FC<SubmitProps> = ({ onSubmit, token }) => {
confirmNewPassword: "",
});
const confirmPasswordReset = () => {
alert(`${resetData.newPassword} - ${token}`);
};
const handlePasswordChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
@@ -77,9 +73,9 @@ const PasswordResetForm: React.FC<SubmitProps> = ({ onSubmit, token }) => {
if (!response.ok) {
const data = await response.json();
throw new Error(data.message || "An error has occurred while resetting");
throw new Error(data.error || "An error has occurred while resetting");
} else {
confirmPasswordReset();
onSubmit(true)
}
} catch (error: any) {
console.error("Password reset error:", error.message);