i don't really understand what's happening here and would appreciate pointing out flaws in my assumptions:
putUser: async (req, res, next) => {
console.log('test1', req.body)
let data = req.body
data["local.password"] = 'xd121244212141243'
console.log('test2', data)
console.log('test3', req.body)
this block of code produces result as:
test1 { 'local.username': 'name','local.password': 'passwordToChange' }
test2 { 'local.username': 'name','local.password': 'xd121244212141243' }
test3 { 'local.username': 'name','local.password': 'xd121244212141243' }
So the question is, why does value of req.body changes ? Is this because we are pointing to the object instead of making new one ?