when user submits edit profile form PUT request will include key value pairs in JSON body to be updated. PUT request edit profile function will first check token to ensure the user should be able to update this information (using jwt.verify). If verified function will carry on and first check to ensure email address in body is either the same as the existing users email address (signifying that the user wishes to keep their email address the same (unless email isnt a required field)) or doesn't match an existing email address as they must be unique. If the function passes those 2 if's it will update the provided fields on the db.
JWTwebtoken package will be required.