Peel the onions, halve and cut into thin slices.
Heat the oil in a frying pan and slowly saute the onions for 10 minutes until soft, stirring.
Season with sugar, salt, mild paprika powder, pepper, caraway and cayenne pepper.
Simmer for about 10 minutes, stirring occasionally, until golden brown.
Sprinkle in with flour and mix well. Pour in the stock and wine, add the bay leaves, bring to the boil and simmer gently for 15 minutes.
Peel the garlic and crush it into the soup. Season with lemon juice, salt and pepper.
Preheat the grill. Sprinkle the baguette slices with the cheese and grill for 2 minutes until the cheese has melted. Place the soup in bowls and place a baguette slice on each one. Sprinkle with thyme and serve immediately.