The Login-Logout defined control adds a Login button and Logout button to the UX component and a placeholder control to display login errors. These buttons can only be used if the UX component's Has integrated login functionality is enabled.
When the user clicks the 'login' button to login, an Ajax callback is made to authenticate the user. There are several server-side events for login and logout: beforeLogin, onLogin, and onLogout. These are accessible in the Server-Side Events page in the UX Component Builder.
When the user logs in or logs out there are several client-side events that fire, as shown in the image below.