From f9328bdecb02b7b5a068af1186d709409c88fc0d Mon Sep 17 00:00:00 2001 From: Nedim Date: Tue, 14 Nov 2023 20:41:51 +0100 Subject: [PATCH] Hotifix --- controllers/users_controller.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/users_controller.go b/controllers/users_controller.go index 6dbfb58..74e2177 100644 --- a/controllers/users_controller.go +++ b/controllers/users_controller.go @@ -130,12 +130,12 @@ func Login(c *gin.Context) { if usr.CheckPassword(user.Password, req.Password) { if user.IsActive && user.LoginAttempts < 10 { // Proceed with creating JWT token and resetting login attempts - if len(user.Companies) == 0 { - c.JSON(http.StatusInternalServerError, gin.H{"error": "User is not connected to a company"}) - return - } + // if len(user.Companies) == 0 { + // c.JSON(http.StatusInternalServerError, gin.H{"error": "User is not connected to a company"}) + // return + // } - token, err := usr.CreateSessionToken(user.ID, user.Companies[0].ID) + token, err := usr.CreateSessionToken(user.ID, 2) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": "Could not create JWT token"}) return