Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ability to log in after changing mail #198

Closed
wants to merge 1 commit into from

Conversation

sanderhurlen
Copy link
Contributor

fixes #180

@sanderhurlen sanderhurlen added the bug This is a bug label May 10, 2021
@sanderhurlen sanderhurlen added this to the Sprint 18 milestone May 10, 2021
@sanderhurlen sanderhurlen self-assigned this May 10, 2021
Comment on lines +82 to +83
if (storedPassword !== strippedOrganizer.password) {
const hashedPassword = await encryptionService.hash(organizerDTO.password)
Copy link
Member

Choose a reason for hiding this comment

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

This in-equality check will always be satisfied.
As the storedPassword can never be equal to the password provided in the request(assuming we never provide the password to the frontend....), as this is either a new one (in plain text, not hashed) or undefined.

To fix this, check if there is a password provided, not undefined and not empty string + (@spiftire is creating validation). Then just hash that password and update, it is not possible to perform an equality as a new hash would always be different, even with the same input :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not log back in after changing email for organizer
3 participants