aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/users/users.hooks.ts2
1 files changed, 1 insertions, 1 deletions
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<HookContext> => {
};
const compareUser = async (context: HookContext): Promise<HookContext> => {
- 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;