cozy / cozy-proxy

This repository was part of CozyV2 which has been deprecated - Cozy authentication and routing layer
https://blog.cozycloud.cc/post/2016/11/21/On-the-road-to-Cozy-version-3
GNU Affero General Public License v3.0
26 stars 31 forks source link

Fixed a crash (and a wrong table splice) #290

Closed babolivier closed 8 years ago

babolivier commented 8 years ago

Fixed the proxy causing an error due to a wrong usage of the updateAttribute method (we don't need to specify the old values). Because of that, cozydb couldn't find the callback and prompted an error without any response being sent to the client.

While I was working on this fix, I also noticed a wrong usage of Array's splice method: as described here the return value is an array containing the removed elements, while the original gets this/these element(s) removed. So we were updating the user's recovery codes with an array containing exclusively the code we wanted to remove, instead of an array containing all the recovery codes except this one. Fixed it too.

nono commented 8 years ago

Thanks!