disallow updating lastUsed from api

This commit is contained in:
Ben Irvin 2022-08-18 12:03:25 +02:00
parent 745a3a8497
commit c61e402461

View File

@ -86,6 +86,11 @@ module.exports = {
attributes.description = trim(body.description);
}
// Don't allow updating lastUsed time
if (has(attributes, 'lastUsed')) {
throw new ApplicationError('lastUsed cannot be updated');
}
await validateApiTokenUpdateInput(attributes);
const apiTokenExists = await apiTokenService.getById(id);