Skip to content

Updating User Image & Password #15

@Alkandari-Y

Description

@Alkandari-Y

When performing an update for the logged in user, we have the following issues:

  • Password is not being hashed and is stored raw in the database
  • Image cannot be updated and is being stored

When the user sends the password, you can either hash the password within an if condition if it is in the req.body or not accept it at all by ensuring that it never gets to the update method.
Additionally, we can add multer as a route middleware and check if user sends an image for an update, then add a conditional to check for req.file when updating the req.body.image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions