Peel onions and cut them into rings. Melt butter. Stew the onions in it at low heat for about 15 minutes until soft, without browning them. Dust with flour. Deglaze with stock and white wine, season with salt and pepper.
Simmer covered soup for about 15 minutes, season again. Cut baguette into slices and roast without fat in a pan. Grate cheese finely. Pour soup into soup bowls. Spread slices of bread on top.
Sprinkle with cheese and bake in a preheated oven (electric range: 225 °C/ convection oven: 200 °C/ gas: level 4) for 5-7 minutes.