Skip to content

Conversation

@gabrielmachin
Copy link
Collaborator

NOTION Ticket

Type of change

  • Fix
  • Story
  • Chore

Description of the change

Create flow for updating user password and adding tests for it.
Flow includes requesting an OTP code, which is send through an email, and validating it for updating the password

@jrg091 jrg091 requested a review from guillezorron December 6, 2023 12:36
email,
},
});
if (!user) throw new ApiError(errors.INVALID_EMAIL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not tell the potential user whether the email is valid or not
The idea would be to prevent someone to use this feature to confirm whether certain email is from one of our users or not.

).rejects.toThrow(new ApiError(errors.INVALID_CODE));
});

test('code is expired', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about the case the token doesn't exist? 😬

Copy link
Collaborator

@jrg091 jrg091 left a comment

Choose a reason for hiding this comment

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

just one small comment on a possible new test and I'm ok to be merged 😬

Comment on lines 1 to 6
html
head
title #{appName} password reset code
body
h1 Hello #{username},
p To recover your password use the next code #{code}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
html
head
title #{appName} password reset code
body
h1 Hello #{username},
p To recover your password use the next code #{code}
html
head
title #{appName} password reset code
body
h1 Hello #{username},
p To recover your password use the next code #{code}.

@gabrielmachin gabrielmachin force-pushed the feat/Reset-password-flow branch from da892d2 to 8ee7a4f Compare January 11, 2024 20:14
@gabrielmachin gabrielmachin merged commit b9b87d9 into main Jan 11, 2024
@gabrielmachin gabrielmachin deleted the feat/Reset-password-flow branch January 11, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants