From 4eaced8b6c21f5171823166ad2e2e393d7c78353 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Jul 2020 13:54:50 +0300 Subject: hotfix: compareUser ts error --- services/users/users.hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts index 125f418..29f1074 100644 --- a/services/users/users.hooks.ts +++ b/services/users/users.hooks.ts @@ -15,7 +15,7 @@ const ignoreCaseRegex = async (context: HookContext): Promise => { }; const compareUser = async (context: HookContext): Promise => { - if (context.arguments[0] !== context.params.user._id) { + if (context.id !== context.params.user._id.toString()) { throw new NotAuthenticated('You can only PATCH/UPDATE your own user!'); } return context; -- cgit v1.2.3