Skip to content

Conversation

@fahadakhan2
Copy link
Contributor

Description:

  • Created the UI
  • Input checks including password criteria (uppercase, number, special char etc.) and wether the confirmation input matches the new password input.
  • Errors thrown if checks are negative
  • Will send a POST request sending the newPassword entered by the user upon submit
  • Added overrides to package json because of some error I was getting with typescript and reactscripts version compatibilities.

UI with filled inputs:
Screenshot 2024-07-03 at 3 41 49 PM

Password criteria error being thrown:
Screenshot 2024-07-03 at 3 42 40 PM

Password matching error being thrown:
Screenshot 2024-07-03 at 3 43 13 PM

…e will be processed once backend method for reset password is created.
@fahadakhan2 fahadakhan2 added the enhancement New feature or request label Jul 3, 2024
@fahadakhan2 fahadakhan2 self-assigned this Jul 3, 2024
@fahadakhan2 fahadakhan2 removed the request for review from justinpchen94 July 3, 2024 20:56
Copy link
Collaborator

@justinpchen94 justinpchen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits mostly

setPasswordError(passwordError);

// TODO: Once handler in backend is created come back here to process the response
const response = await fetch('/api/auth/reset-password', {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general it's nice to put all the API calls into a separate file esp since API calls eventually will be reused. this react component is made slightly messier by having to also include details about the API request itself here, such as the headers and etc

const ResetPassword: React.FC = () => {
const [newPassword, setNewPassword] = useState<string>('');
const [confirmNewPassword, setConfirmNewPassword] = useState<string>('');
const [passwordError, setPasswordError] = useState<string | null>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: passwordValidationError slightly more helpful since this one is currently broad and the other error is more specific

value={confirmNewPassword}
onChange={handleConfirmNewPasswordChange}
/>
{passwordMatchError && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not blocking: not the worst thing in the world but given that your UI only has 2 fields, it's slightly confusing to have the errors shown in 2 different places. i know you're doing a different design than the wireframes but notice that there are differences between input level and global level errors, and the input level errors are shown directly contextually under the inputs where the issues are.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants