Adding password management pages
We need to allow users to manage their passwords. This is quite involved as users often forget their password and hence a secure mechanism to reset the password is also required.
Changing a password
For the user to change their password, they have to supply their existing password and a strong replacement password. Therefore, the frontend needs to send both to the backend and display relevant errors if the current password is incorrect or the new one is too weak. This logic is contained in the following code, which should be added to frontend/src/pages/ChangePassword.tsx:
import axios from "axios"; import { FormikHelpers } from "formik"; import { useContext } from "react"; import { useNavigate } from "react-router-dom"; import { ToastContext } from "src/ToastContext"; import { useMutation } from "src/query"; interface IForm { currentPassword: string; newPassword...