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:
@@ -130,10 +130,10 @@ func Login(c *gin.Context) {
|
|||||||
if usr.CheckPassword(user.Password, req.Password) {
|
if usr.CheckPassword(user.Password, req.Password) {
|
||||||
if user.IsActive && user.LoginAttempts < 10 {
|
if user.IsActive && user.LoginAttempts < 10 {
|
||||||
// Proceed with creating JWT token and resetting login attempts
|
// Proceed with creating JWT token and resetting login attempts
|
||||||
if len(user.Companies) == 0 {
|
// if len(user.Companies) == 0 {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "User is not connected to a company"})
|
// c.JSON(http.StatusInternalServerError, gin.H{"error": "User is not connected to a company"})
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
token, err := usr.CreateSessionToken(user.ID, 2)
|
token, err := usr.CreateSessionToken(user.ID, 2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user