From f27ffe5d43edd04adb76b4b20530c469104529e0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 25 Mar 2020 18:06:42 +0100 Subject: [PATCH] Limit the create account requests --- src/controllers/AccountController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/AccountController.ts b/src/controllers/AccountController.ts index 7535e70..61f2c32 100644 --- a/src/controllers/AccountController.ts +++ b/src/controllers/AccountController.ts @@ -20,7 +20,8 @@ export class AccountController { * @param h Request handler */ public static async Create(h: RequestHandler) { - // TODO : add API limit + // Limit request + await limit_query(h, Action.CREATE_ACCOUNT, false); // Get & check email address const email = h.postEmail("emailAddress"); @@ -37,7 +38,8 @@ export class AccountController { // Try to create the account await AccountHelper.Create(newAccount); - // TODO : trigger the API limit + // Trigger the API limit + await limit_query(h, Action.CREATE_ACCOUNT, true); // Success h.success("The account has been created!");