From 9cdb3260e533e8b24393fe5d0f050f0fd61b10f6 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 18 Apr 2020 13:17:43 +0200 Subject: [PATCH] Can not delete my account --- src/controllers/AccountController.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/AccountController.ts b/src/controllers/AccountController.ts index d6c206f..f71a918 100644 --- a/src/controllers/AccountController.ts +++ b/src/controllers/AccountController.ts @@ -303,6 +303,9 @@ export class AccountController { public static async DeleteAccount(h: RequestHandler) { await h.needUserPostPassword("password"); + if(h.getUserId() < 2) + h.error(401, "You will not delete MY account!"); + await AccountHelper.Delete(h.getUserId()); h.error(500, "Method not completely implemented yet.");