do not return accessToken when listing tokens

This commit is contained in:
Girish Ramakrishnan
2019-02-14 14:55:13 -08:00
parent 1269104112
commit 422abc205b
3 changed files with 12 additions and 1 deletions

View File

@@ -96,6 +96,9 @@ function getTokens(req, res, next) {
clients.getTokensByUserId(req.params.clientId, req.user.id, function (error, result) {
if (error && error.reason === ClientsError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error) return next(new HttpError(500, error));
result = result.map(clients.removeTokenPrivateFields);
next(new HttpSuccess(200, { tokens: result }));
});
}