caipin il y a 3 ans
Parent
commit
413ec5667d
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      services/jl_service.go

+ 4 - 4
services/jl_service.go

@@ -300,11 +300,11 @@ func (s *JlService) ProjectExist(projectId int, accountId int) (map[string]inter
 	}
 
 	debug := GetEnvInfo("DEBUG")
-
+	expirationTime := time.Now().Add(6 * time.Second)
 	tokenString, _ := utils.CreateJlToken(jwt.MapClaims{
-		"code":    projectData.Code,
-		"account": accountData.Account,
-		"exp":     time.Now().Add(24 * time.Hour).Unix(),
+		"data": map[string]string{"code": projectData.Code, "account": accountData.Account},
+		"exp":  expirationTime.Unix(),
+		"iat":  time.Now().Unix(),
 	})
 	return map[string]interface{}{"env": debug, "token": tokenString}, nil
 }