From d72b4f4d634dc57f0bad8e70beea4df3fe1789a8 Mon Sep 17 00:00:00 2001 From: Nilo Roberto C Paim Date: Tue, 5 Sep 2023 15:44:39 -0300 Subject: [PATCH] checking blocked user on login --- controllers/authController.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controllers/authController.go b/controllers/authController.go index ef1b886..c41d264 100644 --- a/controllers/authController.go +++ b/controllers/authController.go @@ -48,6 +48,15 @@ func Login(c *fiber.Ctx) error { "token": ""}) } + if user.Blocked == "S" { + return c.JSON(fiber.Map{ + "message": "Usuário bloqueado", + "userId": 0, + "userType": "", + "userName": "", + "token": ""}) + } + type customClaims struct { Userid string `json:"user"` jwt.StandardClaims