//GenerateToken generates a new JWT token
GenerateToken generates a new JWT token
// GenerateToken generates a new JWT token
func (manager *AuthManager) GenerateToken(userID uint) (string, error) {
	expirationTime := time.Now().Add(10 * time.Minute)
	claims := &UserClaims{
		ID: userID,
		StandardClaims: jwt.StandardClaims{
			ExpiresAt: expirationTime.Unix(),
		},
	}
	token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
	tokenString, err := token.SignedString([]byte(manager.TokenSecret))
	if err != nil {
		return "", err
	}
	return tokenString, nil
}
func ( manager * AuthManager ) GenerateToken ( userID uint ) ( string , error ) { expirationTime := time . Now ( ) . Add ( 10 * time . Minute ) claims := & UserClaims { ID : userID , StandardClaims : jwt . StandardClaims { ExpiresAt : expirationTime . Unix ( ) , } , } token := jwt . NewWithClaims ( jwt . SigningMethodHS256 , claims ) tokenString , err := token . SignedString ( [ ] byte ( manager . TokenSecret ) ) if err != nil { return " " , err } return tokenString , nil }
GenerateToken generates a new JWT token
GenerateToken generates a new JWT token