Some extra changes
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
2023-05-09 20:04:11 -04:00
parent d6a72ace83
commit 991dc32ce4

View File

@@ -45,6 +45,9 @@ router.post(process.env.RESET_ROUTE || RESET_ROUTE, async (ctx, next) => {
}); });
router.patch('/:record', authenticated(), (ctx: Koa.Context) => { router.patch('/:record', authenticated(), (ctx: Koa.Context) => {
if (ctx.user !== ctx.param.record) {
ctx.throw(StatusCodes.UNAUTHORIZED);
}
const data = Auth.findOneAndUpdate({ record: ctx.params.record }); const data = Auth.findOneAndUpdate({ record: ctx.params.record });
if (!data) { if (!data) {
ctx.throw(StatusCodes.NOT_FOUND); ctx.throw(StatusCodes.NOT_FOUND);