UPDATE: Now checks for token on url to extract.

This commit is contained in:
EvanLin3141
2025-02-06 15:44:20 +00:00
parent af71f63873
commit 00d627a1e2
2 changed files with 34 additions and 11 deletions

View File

@@ -15,9 +15,10 @@ interface ResetPasswordErrors {
interface SubmitProps {
onSubmit: () => void;
token: string;
}
const PasswordResetForm: React.FC<SubmitProps> = ({ onSubmit }) => {
const PasswordResetForm: React.FC<SubmitProps> = ({ onSubmit, token }) => {
const [errors, setErrors] = useState<ResetPasswordErrors>({});
@@ -63,7 +64,7 @@ const PasswordResetForm: React.FC<SubmitProps> = ({ onSubmit }) => {
if (validateResetForm()) {
try {
const response = await fetch("/user/reset_password/<string:token>/<string:confirmNewPassword>", {
const response = await fetch("/user/reset_password/<string:${token}", {
method: "POST",
headers: {
"Content-Type": "application/json",