Flash messages don't disappear after phx.gen.auth injected code

I think there’s an issue with flash/1 in core_components.ex that was introduced by an update in 1.7.7..1.7.8. Specifically this part:

attr :id, :string, default: nil, doc: "the optional id of flash container"
attr :flash, :map, default: %{}, doc: "the map of flash messages to display"
attr :title, :string, default: nil
attr :kind, :atom, values: [:info, :error], doc: "used for styling and flash lookup"
slot :inner_block, doc: "the optional inner block that renders the flash message"

def flash(assigns) do assigns = assign_new(assigns, :id, fn -> "flash-#{assigns.kind}" end)

The assign_new callback never be invoked as :id would be nil due to the attr macro specifying the default: nil. This would mean that it’s effectively given an empty string as its id attribute and breaks the closing behaviour.

One thing you can do to fix this problem in core_components.ex is to update the attr definition for :id by removing default: nil.