Bring a large Dutch oven pot over low heat and add the olive oil once hot. Add the onions, sugar, bay leaf and a pinch of salt. Cook, stirring occasionally for 30 to 45 minutes to caramelize.
Add the garlic, thyme, oregano and cook for another minute.
Pour the wine and turn the heat to medium. Simmer until wine evaporates, about 2 minutes.
Reduce the heat to low, add the flour and cook for 1 minute stirring frequently.
Add the vegetable broth, salt, pepper and simmer, uncovered, on low for 10 minutes. Stir occasionally to avoid sticking to the bottom of the pan. Remove the bay leaf.
Preheat a broiler on high or oven at 430º F.
When the soup is ready, pour carefully into an oven safe bowl and add the cubes of baguette to the soup and the cheese on top of the bread. Broil until slightly brown and the cheese is melted. Serve immediately.