I was able to build the widget in typescript and it is working well. But after the logout the widget still exists. It seems that the logout has no effect on the widget.