Merge branch 'hotfix' into 'main'

Hotifix

See merge request ukacorp/mesari/backend!29
This commit was merged in pull request #29.
This commit is contained in:
2023-11-21 06:56:02 +00:00

View File

@@ -130,10 +130,10 @@ 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, 2)
if err != nil {