Make sure the that the login button is only visible for guests/anonymous users and the logout button for user and administrator.
When you enabled Anonymous users, you picked a user role that anonymous users will have. If you set up your app so that this user role is only used by Anonymous users, you can set permissions on the microflow that is called by the login button so that only users with the Anonymous user role can execute it. In this way, when your user logs in, they will have a different user role and won't see the login button.
You'll need to map the user role for Anonymous users to the module role that contains the microflow called by your login button.
Hope that helps,