rcos / observatory-server

A project tracking dashboard for Rensselaer Center for Open Source
https://rcos.io
MIT License
14 stars 51 forks source link

refactored user controller #809

Closed TungE closed 5 years ago

TungE commented 5 years ago

Addresses #808.

Most functions (as appropriate) were refactored to use the async/await syntax (rather than callbacks), more consistent whitespacing, simplified logic flow, and updated a few instances of deprecated functions (res.json(status, obj) --> res.status(status).json(obj)).

Notably, the publicStats and destroy functions have not been refactored. Alex S. mentioned that the destroy function has some blatant security flaw and should be looked at.

In using "npm test", all tests passed except for 1 pending, which is pending because expiresInMinutes and expiresInSeconds are deprecated, although I'm not sure how I can fix this on my end. This may have stopped the rest of the user controller from even being tested.

aeksco commented 5 years ago

:+1: Terrific work - merging this in :shipit: