From 3c449214d1f484530a1748b5f55a9b25364b6bb5 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Tue, 5 Dec 2023 17:53:35 +0700 Subject: [PATCH] Add error messages for MI expired client secret, num uses limit reached --- .../src/ee/controllers/v3/machineIdentityController.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/ee/controllers/v3/machineIdentityController.ts b/backend/src/ee/controllers/v3/machineIdentityController.ts index 489338362..4057a84b2 100644 --- a/backend/src/ee/controllers/v3/machineIdentityController.ts +++ b/backend/src/ee/controllers/v3/machineIdentityController.ts @@ -333,7 +333,9 @@ export const loginMI = async (req: Request, res: Response) => { } ); - throw UnauthorizedRequestError(); + throw UnauthorizedRequestError({ + message: "Failed to authenticate MI credentials due to expired client secret" + }); } } @@ -350,7 +352,9 @@ export const loginMI = async (req: Request, res: Response) => { } ); - throw UnauthorizedRequestError(); + throw UnauthorizedRequestError({ + message: "Failed to authenticate MI credentials due to client secret number of uses limit reached" + }); } // increment usage count by 1